lkml.org 
[lkml]   [2017]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 6/9] mm: set mapping error when launder_pages fails
Date
On Wed, 2017-03-08 at 11:29 -0500, Jeff Layton wrote:
> If launder_page fails, then we hit a problem writing back some inode
> data. Ensure that we communicate that fact in a subsequent fsync
> since
> another task could still have it open for write.
>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  mm/truncate.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/mm/truncate.c b/mm/truncate.c
> index 6263affdef88..29ae420a5bf9 100644
> --- a/mm/truncate.c
> +++ b/mm/truncate.c
> @@ -594,11 +594,15 @@ invalidate_complete_page2(struct address_space
> *mapping, struct page *page)
>  
>  static int do_launder_page(struct address_space *mapping, struct
> page *page)
>  {
> + int ret;
> +
>   if (!PageDirty(page))
>   return 0;
>   if (page->mapping != mapping || mapping->a_ops->launder_page
> == NULL)
>   return 0;
> - return mapping->a_ops->launder_page(page);
> + ret = mapping->a_ops->launder_page(page);
> + mapping_set_error(mapping, ret);
> + return ret;
>  }
>  
>  /**

No. At that layer, you don't know that this is a page error. In the NFS
case, it could, for instance, just as well be a fatal signal.

--
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@primarydata.com
\
 
 \ /
  Last update: 2017-03-08 19:03    [W:0.129 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site