From: Tejun Heo <tj@kernel.org>
To: Junichi Nomura <j-nomura@ce.jp.nec.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"andi@firstfloor.org" <andi@firstfloor.org>,
"fengguang.wu@intel.com" <fengguang.wu@intel.com>,
"tony.luck@intel.com" <tony.luck@intel.com>,
"david@fromorbit.com" <david@fromorbit.com>,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Subject: Re: [PATCH v2] fs: global sync to not clear error status of individual inodes
Date: Wed, 16 Sep 2015 13:47:15 -0400 [thread overview]
Message-ID: <20150916174715.GF3243@mtj.duckdns.org> (raw)
In-Reply-To: <20150916083908.GA12244@xzibit.linux.bs1.fc.nec.co.jp>
On Wed, Sep 16, 2015 at 08:39:09AM +0000, Junichi Nomura wrote:
> filemap_fdatawait() is a function to wait for on-going writeback
> to complete but also consume and clear error status of the mapping
> set during writeback.
> The latter functionality is critical for applications to detect
> writeback error with system calls like fsync(2)/fdatasync(2).
>
> However filemap_fdatawait() is also used by sync(2) or FIFREEZE
> ioctl, which don't check error status of individual mappings.
>
> As a result, fsync() may not be able to detect writeback error
> if events happen in the following order:
>
> Application System admin
> ----------------------------------------------------------
> write data on page cache
> Run sync command
> writeback completes with error
> filemap_fdatawait() clears error
> fsync returns success
> (but the data is not on disk)
>
> This patch adds filemap_fdatawait_keep_errors() for call sites where
> writeback error is not handled so that they don't clear error status.
>
> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
> Acked-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2015-09-16 17:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-15 9:46 [PATCH 0/1] Fix false-negative error reporting from fsync/fdatasync Junichi Nomura
2015-09-15 9:49 ` Test program: check if fsync() can detect I/O error (1/2) Junichi Nomura
2015-09-15 9:52 ` Test program: check if fsync() can detect I/O error (2/2) Junichi Nomura
2015-09-15 9:54 ` [PATCH 1/1] fs: global sync to not clear error status of individual inodes Junichi Nomura
2015-09-15 14:37 ` Andi Kleen
2015-09-15 22:02 ` Andrew Morton
2015-09-16 0:45 ` Junichi Nomura
2015-09-16 10:45 ` xfstests: test data-writeback error detection with fsync Junichi Nomura
2015-09-15 15:20 ` [PATCH 1/1] fs: global sync to not clear error status of individual inodes Tejun Heo
2015-09-15 16:52 ` Andi Kleen
2015-09-16 0:59 ` Junichi Nomura
2015-09-16 8:39 ` [PATCH v2] " Junichi Nomura
2015-09-16 17:47 ` Tejun Heo [this message]
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=20150916174715.GF3243@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=david@fromorbit.com \
--cc=fengguang.wu@intel.com \
--cc=j-nomura@ce.jp.nec.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=tony.luck@intel.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;
as well as URLs for NNTP newsgroup(s).