From: Muchun Song <songmuchun@bytedance.com>
To: Ajay Garg <ajaygargnsit@gmail.com>
Cc: Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: shmem: do not call PageHWPoison on a ERR-page
Date: Thu, 11 Nov 2021 20:11:56 +0800 [thread overview]
Message-ID: <CAMZfGtXCFJ3NUw-bBsphLbCtdDAfHERAEkTSMU9k1cfd4DrRMA@mail.gmail.com> (raw)
In-Reply-To: <CAHP4M8VNZY+NLzUAVHTWK6a6pggvv4a-q9nvYAqkkco6id3Tog@mail.gmail.com>
On Thu, Nov 11, 2021 at 7:40 PM Ajay Garg <ajaygargnsit@gmail.com> wrote:
>
> >
> > How about the following changes since the above if block
> > already do the judgment?
> >
> > diff --git a/mm/shmem.c b/mm/shmem.c
> > index f0eee4e221a7..0c84b6624026 100644
> > --- a/mm/shmem.c
> > +++ b/mm/shmem.c
> > @@ -4195,13 +4195,13 @@ struct page *shmem_read_mapping_page_gfp(struct
> > address_space *mapping,
> > BUG_ON(!shmem_mapping(mapping));
> > error = shmem_getpage_gfp(inode, index, &page, SGP_CACHE,
> > gfp, NULL, NULL, NULL);
> > - if (error)
> > + if (error) {
> > page = ERR_PTR(error);
> > - else
> > + } else {
> > unlock_page(page);
> > -
> > - if (PageHWPoison(page))
> > - page = ERR_PTR(-EIO);
> > + if (PageHWPoison(page))
> > + page = ERR_PTR(-EIO);
> > + }
> >
> > return page;
>
>
> You have
>
> * simply put braces (not required for 1-liner if/else blocks)
> * contributed nothing to the issue the patch addresses.
>
> I hope this is not a deliberate joke/spam.
What? I put "if (PageHWPoison(page))" into the else branch,
it should be added braces since it's not 1-line blocks. Why do
you think it does not address the issue? What am I missing
here?
next prev parent reply other threads:[~2021-11-11 12:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 8:46 [PATCH] mm: shmem: do not call PageHWPoison on a ERR-page Ajay Garg
2021-11-11 11:06 ` Muchun Song
2021-11-11 11:40 ` Ajay Garg
2021-11-11 12:11 ` Muchun Song [this message]
2021-11-11 12:21 ` Ajay Garg
2021-11-11 13:09 ` Muchun Song
2021-11-11 18:42 ` Yang Shi
2021-11-11 17:45 ` Ajay Garg
2021-11-11 17:59 ` Jens Axboe
2021-11-13 17:21 ` Jens Axboe
2021-11-13 20:16 ` Linus Torvalds
2021-11-13 20:21 ` Jens Axboe
2021-11-13 20:23 ` Linus Torvalds
2021-11-13 22:29 ` Yang Shi
2021-11-13 22:58 ` Linus Torvalds
2021-11-14 3:10 ` Yang Shi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMZfGtXCFJ3NUw-bBsphLbCtdDAfHERAEkTSMU9k1cfd4DrRMA@mail.gmail.com \
--to=songmuchun@bytedance.com \
--cc=ajaygargnsit@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).