All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-shmem-dont-truncate-page-if-memory-failure-happens-fix.patch added to -mm tree
@ 2021-10-22  2:35 akpm
  2021-10-22  6:42 ` Stephen Rothwell
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2021-10-22  2:35 UTC (permalink / raw)
  To: bot, mm-commits, nathan, sfr, shy828301


The patch titled
     Subject: mm/memory_failure: initialize extra_pins in me_pagecache_clean()
has been added to the -mm tree.  Its filename is
     mm-shmem-dont-truncate-page-if-memory-failure-happens-fix.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-shmem-dont-truncate-page-if-memory-failure-happens-fix.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-shmem-dont-truncate-page-if-memory-failure-happens-fix.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Nathan Chancellor <nathan@kernel.org>
Subject: mm/memory_failure: initialize extra_pins in me_pagecache_clean()

Clang warns:

mm/memory-failure.c:892:6: error: variable 'extra_pins' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
        if (!mapping) {
            ^~~~~~~~
mm/memory-failure.c:915:32: note: uninitialized use occurs here
        if (has_extra_refcount(ps, p, extra_pins))
                                      ^~~~~~~~~~
mm/memory-failure.c:892:2: note: remove the 'if' if its condition is always false
        if (!mapping) {
        ^~~~~~~~~~~~~~~
mm/memory-failure.c:879:6: error: variable 'extra_pins' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
        if (PageAnon(p)) {
            ^~~~~~~~~~~
mm/memory-failure.c:915:32: note: uninitialized use occurs here
        if (has_extra_refcount(ps, p, extra_pins))
                                      ^~~~~~~~~~
mm/memory-failure.c:879:2: note: remove the 'if' if its condition is always false
        if (PageAnon(p)) {
        ^~~~~~~~~~~~~~~~~~
mm/memory-failure.c:871:17: note: initialize the variable 'extra_pins' to silence this warning
        bool extra_pins;
                       ^
                        = 0
2 errors generated.

Initialize extra_pins to false so that it is not used uninitialized.

Link: https://lkml.kernel.org/r/20211021180336.2328086-1-nathan@kernel.org
Fixes: d882a43a0011 ("mm: shmem: don't truncate page if memory failure happens")
Link: https://github.com/ClangBuiltLinux/linux/issues/1487
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Acked-by: Yang Shi <shy828301@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memory-failure.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/memory-failure.c~mm-shmem-dont-truncate-page-if-memory-failure-happens-fix
+++ a/mm/memory-failure.c
@@ -868,7 +868,7 @@ static int me_pagecache_clean(struct pag
 {
 	int ret;
 	struct address_space *mapping;
-	bool extra_pins;
+	bool extra_pins = false;
 
 	delete_from_lru_cache(p);
 
_

Patches currently in -mm which might be from nathan@kernel.org are

mm-shmem-dont-truncate-page-if-memory-failure-happens-fix.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: + mm-shmem-dont-truncate-page-if-memory-failure-happens-fix.patch added to -mm tree
  2021-10-22  2:35 + mm-shmem-dont-truncate-page-if-memory-failure-happens-fix.patch added to -mm tree akpm
@ 2021-10-22  6:42 ` Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2021-10-22  6:42 UTC (permalink / raw)
  To: akpm; +Cc: bot, mm-commits, nathan, shy828301

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

Hi all,

On Thu, 21 Oct 2021 19:35:29 -0700 akpm@linux-foundation.org wrote:
>
> The patch titled
>      Subject: mm/memory_failure: initialize extra_pins in me_pagecache_clean()
> has been added to the -mm tree.  Its filename is
>      mm-shmem-dont-truncate-page-if-memory-failure-happens-fix.patch

Added to linux-next today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-22  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22  2:35 + mm-shmem-dont-truncate-page-if-memory-failure-happens-fix.patch added to -mm tree akpm
2021-10-22  6:42 ` Stephen Rothwell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.