All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@primarydata.com>
To: "viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"jlayton@redhat.com" <jlayton@redhat.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: "linux-nilfs@vger.kernel.org" <linux-nilfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"konishi.ryusuke@lab.ntt.co.jp" <konishi.ryusuke@lab.ntt.co.jp>,
	"neilb@suse.com" <neilb@suse.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"adilger@dilger.ca" <adilger@dilger.ca>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"ross.zwisler@linux.intel.com" <ross.zwisler@linux.intel.com>,
	"openosd@gmail.com" <openosd@gmail.com>,
	"jack@suse.cz" <jack@suse.cz>
Subject: Re: [PATCH v2 6/9] mm: set mapping error when launder_pages fails
Date: Wed, 8 Mar 2017 18:01:47 +0000	[thread overview]
Message-ID: <1488996103.3098.4.camel@primarydata.com> (raw)
In-Reply-To: <20170308162934.21989-7-jlayton@redhat.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 1410 bytes --]

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
N‹§²æìr¸›zǧu©ž²Æ {\b­†éì¹»\x1c®&Þ–)îÆi¢žØ^n‡r¶‰šŽŠÝ¢j$½§$¢¸\x05¢¹¨­è§~Š'.)îÄÃ,yèm¶ŸÿÃ\f%Š{±šj+ƒðèž×¦j)Z†·Ÿ

WARNING: multiple messages have this Message-ID (diff)
From: Trond Myklebust <trondmy@primarydata.com>
To: "viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"jlayton@redhat.com" <jlayton@redhat.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: "linux-nilfs@vger.kernel.org" <linux-nilfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"konishi.ryusuke@lab.ntt.co.jp" <konishi.ryusuke@lab.ntt.co.jp>,
	"neilb@suse.com" <neilb@suse.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"adilger@dilger.ca" <adilger@dilger.ca>,
	"James.Bottomley@HansenPartnership.com" 
	<James.Bottomley@HansenPartnership.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"ross.zwisler@linux.intel.com" <ross.zwisler@linux.intel.com>,
	"openosd@gmail.com" <openosd@gmail.com>,
	"jack@suse.cz" <jack@suse.cz>
Subject: Re: [PATCH v2 6/9] mm: set mapping error when launder_pages fails
Date: Wed, 8 Mar 2017 18:01:47 +0000	[thread overview]
Message-ID: <1488996103.3098.4.camel@primarydata.com> (raw)
In-Reply-To: <20170308162934.21989-7-jlayton@redhat.com>

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

  reply	other threads:[~2017-03-08 18:01 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 16:29 [PATCH v2 0/9] mm/fs: get PG_error out of the writeback reporting business Jeff Layton
2017-03-08 16:29 ` Jeff Layton
2017-03-08 16:29 ` [PATCH v2 1/9] mm: fix mapping_set_error call in me_pagecache_dirty Jeff Layton
2017-03-08 16:29   ` Jeff Layton
2017-03-10  0:06   ` Ross Zwisler
2017-03-10  0:06     ` Ross Zwisler
2017-03-08 16:29 ` [PATCH v2 2/9] mm: drop "wait" parameter from write_one_page Jeff Layton
2017-03-08 16:29   ` Jeff Layton
2017-03-10  0:07   ` Ross Zwisler
2017-03-10  0:07     ` Ross Zwisler
2017-03-08 16:29 ` [PATCH v2 3/9] mm: clear any AS_* errors when returning error on any fsync or close Jeff Layton
2017-03-08 16:29   ` Jeff Layton
2017-03-08 21:23   ` NeilBrown
2017-03-09  0:10     ` Jeff Layton
2017-03-09  0:10       ` Jeff Layton
2017-03-10  0:09   ` Ross Zwisler
2017-03-10  0:09     ` Ross Zwisler
2017-03-10  3:08     ` Jeff Layton
2017-03-10  3:08       ` Jeff Layton
2017-03-10  3:08       ` Jeff Layton
2017-03-10  3:08       ` Jeff Layton
2017-03-08 16:29 ` [PATCH v2 4/9] nilfs2: set the mapping error when calling SetPageError on writeback Jeff Layton
2017-03-08 16:29   ` Jeff Layton
2017-03-08 16:29 ` [PATCH v2 5/9] dax: set error in mapping when writeback fails Jeff Layton
2017-03-08 16:29   ` Jeff Layton
2017-03-10  0:21   ` Ross Zwisler
2017-03-10  0:21     ` Ross Zwisler
2017-03-08 16:29 ` [PATCH v2 6/9] mm: set mapping error when launder_pages fails Jeff Layton
2017-03-08 16:29   ` Jeff Layton
2017-03-08 18:01   ` Trond Myklebust [this message]
2017-03-08 18:01     ` Trond Myklebust
2017-03-08 18:38     ` Jeff Layton
2017-03-08 18:38       ` Jeff Layton
2017-03-08 18:38       ` Jeff Layton
2017-03-08 19:16       ` Trond Myklebust
2017-03-08 21:28     ` NeilBrown
2017-03-08 21:28       ` NeilBrown
2017-03-08 16:29 ` [PATCH v2 7/9] mm: ensure that we set mapping error if writeout() fails Jeff Layton
2017-03-08 16:29   ` Jeff Layton
2017-03-08 16:29 ` [PATCH v2 8/9] mm: don't TestClearPageError in __filemap_fdatawait_range Jeff Layton
2017-03-08 16:29   ` Jeff Layton
2017-03-08 16:29 ` [PATCH v2 9/9] Documentation: document what to do on a writeback error Jeff Layton
2017-03-08 16:29   ` Jeff Layton

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=1488996103.3098.4.camel@primarydata.com \
    --to=trondmy@primarydata.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=adilger@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=jlayton@redhat.com \
    --cc=konishi.ryusuke@lab.ntt.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=neilb@suse.com \
    --cc=openosd@gmail.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.