From: Ajay Garg <ajaygargnsit@gmail.com>
To: Muchun Song <songmuchun@bytedance.com>
Cc: hughd@google.com, akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: shmem: do not call PageHWPoison on a ERR-page
Date: Thu, 11 Nov 2021 17:10:24 +0530 [thread overview]
Message-ID: <CAHP4M8VNZY+NLzUAVHTWK6a6pggvv4a-q9nvYAqkkco6id3Tog@mail.gmail.com> (raw)
In-Reply-To: <6864f744-ca3e-f328-8793-2adb0146db03@bytedance.com>
>
> 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.
next prev parent reply other threads:[~2021-11-11 11:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 8:46 Ajay Garg
2021-11-11 11:06 ` Muchun Song
2021-11-11 11:40 ` Ajay Garg [this message]
2021-11-11 12:11 ` Muchun Song
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=CAHP4M8VNZY+NLzUAVHTWK6a6pggvv4a-q9nvYAqkkco6id3Tog@mail.gmail.com \
--to=ajaygargnsit@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=songmuchun@bytedance.com \
/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