lkml.org 
[lkml]   [2021]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm: shmem: do not call PageHWPoison on a ERR-page
>
> 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.

\
 
 \ /
  Last update: 2021-11-11 12:41    [W:0.069 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site