[v2,02/17] mm: fix mapping_set_error call in me_pagecache_dirty
diff mbox

Message ID 20170412120614.6111-3-jlayton@redhat.com
State New
Headers show

Commit Message

Jeff Layton April 12, 2017, 12:05 p.m. UTC
The error code should be negative. Since this ends up in the default
case anyway, this is harmless, but it's less confusing to negate it.
Also, later patches will require a negative error code here.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
 mm/memory-failure.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Kara April 12, 2017, 12:16 p.m. UTC | #1
On Wed 12-04-17 08:05:59, Jeff Layton wrote:
> The error code should be negative. Since this ends up in the default
> case anyway, this is harmless, but it's less confusing to negate it.
> Also, later patches will require a negative error code here.
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>

Looks good. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  mm/memory-failure.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 27f7210e7fab..4b56e53e5378 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -674,7 +674,7 @@ static int me_pagecache_dirty(struct page *p, unsigned long pfn)
>  		 * the first EIO, but we're not worse than other parts
>  		 * of the kernel.
>  		 */
> -		mapping_set_error(mapping, EIO);
> +		mapping_set_error(mapping, -EIO);
>  	}
>  
>  	return me_pagecache_clean(p, pfn);
> -- 
> 2.9.3
>
Matthew Wilcox April 12, 2017, 2:28 p.m. UTC | #2
On Wed, Apr 12, 2017 at 08:05:59AM -0400, Jeff Layton wrote:
> The error code should be negative. Since this ends up in the default
> case anyway, this is harmless, but it's less confusing to negate it.
> Also, later patches will require a negative error code here.
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>

Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>

Patch
diff mbox

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 27f7210e7fab..4b56e53e5378 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -674,7 +674,7 @@  static int me_pagecache_dirty(struct page *p, unsigned long pfn)
 		 * the first EIO, but we're not worse than other parts
 		 * of the kernel.
 		 */
-		mapping_set_error(mapping, EIO);
+		mapping_set_error(mapping, -EIO);
 	}
 
 	return me_pagecache_clean(p, pfn);