Re: [Lsf-pc] [LSF/MM TOPIC] do we really need PG_error at all?

2017-02-27 Thread Jeff Layton
allowed to service reads (assuming that it was uptodate before)? Can I redirty it and have it retry the write? Is there standard behavior for this or is it just up to the whim of the filesystem? I'll probably have questions about the read side as well, but for now it looks like it's mostly used in an ad-hoc way to communicate errors across subsystems (block to fs layer, for instance). -- Jeff Layton <jlay...@redhat.com>

Re: [Lsf-pc] [LSF/MM TOPIC] do we really need PG_error at all?

2017-02-28 Thread Jeff Layton
On Tue, 2017-02-28 at 12:12 +0200, Boaz Harrosh wrote: > On 02/28/2017 03:11 AM, Jeff Layton wrote: > <> > > > > I'll probably have questions about the read side as well, but for now it > > looks like it's mostly used in an ad-hoc way to communicate errors > >

Re: [LSF/MM TOPIC] do we really need PG_error at all?

2017-02-26 Thread Jeff Layton
On Mon, 2017-02-27 at 08:03 +1100, NeilBrown wrote: > On Sun, Feb 26 2017, James Bottomley wrote: > > > [added linux-scsi and linux-block because this is part of our error > > handling as well] > > On Sun, 2017-02-26 at 09:42 -0500, Jeff Layton wrote: > > >

Re: [LSF/MM TOPIC] do we really need PG_error at all?

2017-02-27 Thread Jeff Layton
ux-block because this is part of our error > > > > handling as well] > > > > On Sun, 2017-02-26 at 09:42 -0500, Jeff Layton wrote: > > > > > Proposing this as a LSF/MM TOPIC, but it may turn out to be me > > > > > just not understanding the

Re: [LSF/MM TOPIC] do we really need PG_error at all?

2017-02-26 Thread Jeff Layton
> > > On Sun, 2017-02-26 at 09:42 -0500, Jeff Layton wrote: > > > > Proposing this as a LSF/MM TOPIC, but it may turn out to be me > > > > just not understanding the semantics here. > > > > > > > > As I was looking into -ENOS

LSF/MM 2017: Call for Proposals closes January 15th

2017-01-09 Thread Jeff Layton
age: James Bottomley Martin K. Petersen (track chair) Sagi Grimberg Filesystems: Anna Schumaker Chris Mason Eric Sandeen Jan Kara     Jeff Layton (summit chair) Josef Bacik (track chair) Trond Myklebust MM: Johannes Weiner Rik van Riel (track chair) -- J

LSF/MM 2017: Call for Proposals

2016-12-27 Thread Jeff Layton
age: James Bottomley Martin K. Petersen (track chair) Sagi Grimberg Filesystems: Anna Schumaker Chris Mason Eric Sandeen Jan Kara     Jeff Layton (summit chair) Josef Bacik (track chair) Trond Myklebust MM: Johannes Weiner Rik van Riel (track chair) -- J

Re: [PATCH v3 20/20] gfs2: clean up some filemap_* calls

2017-04-24 Thread Jeff Layton
(b) write mapping > (c) wait for mapping > (d) wait for metamapping > > If you use the helper for both, it becomes, (a & d)(b & c) which is probably > acceptable. (I think we just tried to optimize what the elevator was doing). > > But the way you've got it coded here still looks wrong. It looks like: > (a) > if (ip) >(b & c) > ELSE - >(d) > > So (d) (metamapping) isn't guaranteed to be synced at the end of the function. > Of course, you know the modified helper functions better than I do. > What am I missing? > > You're right of course. I'll fix that up in my tree. Thanks! -- Jeff Layton <jlay...@redhat.com>

Re: [PATCH v3 20/20] gfs2: clean up some filemap_* calls

2017-04-24 Thread Jeff Layton
lemap_fdatawait calls into filemap_write_and_wait. > > That will at least return writeback errors that occur during the write > > phase. > > > > Signed-off-by: Jeff Layton <jlay...@redhat.com> > > --- > > fs/gfs2/glops.c | 12 > > fs/gfs2/lops.c | 4 +--

Re: [PATCH v3 10/20] fuse: set mapping error in writepage_locked when it fails

2017-04-24 Thread Jeff Layton
On Mon, 2017-04-24 at 18:04 +0200, Jan Kara wrote: > On Mon 24-04-17 09:22:49, Jeff Layton wrote: > > This ensures that we see errors on fsync when writeback fails. > > > > Signed-off-by: Jeff Layton <jlay...@redhat.com> > > Hum, but do we really want to clob

Re: [PATCH v3 11/20] cifs: set mapping error when page writeback fails in writepage or launder_pages

2017-04-24 Thread Jeff Layton
On Mon, 2017-04-24 at 08:27 -0700, Christoph Hellwig wrote: > On Mon, Apr 24, 2017 at 09:22:50AM -0400, Jeff Layton wrote: > > Signed-off-by: Jeff Layton <jlay...@redhat.com> > > --- > > fs/cifs/file.c | 10 ++ > > 1 file changed, 6 insertions(+), 4 dele

Re: [PATCH v8 12/18] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-06-29 Thread Jeff Layton
On Thu, 2017-06-29 at 10:11 -0700, Darrick J. Wong wrote: > On Thu, Jun 29, 2017 at 09:19:48AM -0400, jlay...@kernel.org wrote: > > From: Jeff Layton <jlay...@redhat.com> > > > > Let's try to make this extra clear for fs authors. > > > > Cc: Jan Kara <j.

Re: [PATCH v8 03/18] fs: check for writeback errors after syncing out buffers in generic_file_fsync

2017-06-29 Thread Jeff Layton
On Thu, 2017-06-29 at 07:19 -0700, Christoph Hellwig wrote: > On Thu, Jun 29, 2017 at 09:19:39AM -0400, jlay...@kernel.org wrote: > > From: Jeff Layton <jlay...@redhat.com> > > > > ext2 currently does a test+clear of the AS_EIO flag, which is > > is pr

Re: [PATCH v8 10/18] fs: new infrastructure for writeback error handling and reporting

2017-06-29 Thread Jeff Layton
On Thu, 2017-06-29 at 09:19 -0400, jlay...@kernel.org wrote: > From: Jeff Layton <jlay...@redhat.com> > > Most filesystems currently use mapping_set_error and > filemap_check_errors for setting and reporting/clearing writeback errors > at the mapping level. filemap_check

Re: [PATCH v8 16/18] ext4: use errseq_t based error handling for reporting data writeback errors

2017-06-29 Thread Jeff Layton
t also doesn't > seem to belong into this patch. I revised the patch description earlier to say: While we're at it, ensure we always "goto out" instead of just returning directly, so that we always hit the exit tracepoint. ...but I'm fine with taking that out if you prefer. -- Jeff Layton <jlay...@poochiereds.net>

Re: [PATCH v8 18/18] btrfs: minimal conversion to errseq_t writeback error reporting on fsync

2017-06-29 Thread Jeff Layton
On Thu, 2017-06-29 at 07:17 -0700, Christoph Hellwig wrote: > On Thu, Jun 29, 2017 at 09:19:54AM -0400, jlay...@kernel.org wrote: > > From: Jeff Layton <jlay...@redhat.com> > > > > Just check and advance the errseq_t in the file before returning. > > Intern

Re: [PATCH v8 17/18] xfs: minimal conversion to errseq_t writeback error reporting

2017-06-30 Thread Jeff Layton
ecomes a pretty straight conversion to file_write_and_wait_range -- one liner patches for the most part. I've started rolling patches to do that, but now I'm wondering... Should I aim to do that with an individual patch for each fs, or is it better to do a swath of them all at once in a single patch

Re: [PATCH v8 10/18] fs: new infrastructure for writeback error handling and reporting

2017-06-29 Thread Jeff Layton
On Thu, 2017-06-29 at 09:19 -0400, jlay...@kernel.org wrote: > From: Jeff Layton <jlay...@redhat.com> > > Most filesystems currently use mapping_set_error and > filemap_check_errors for setting and reporting/clearing writeback errors > at the mapping level. filemap_check

Re: [PATCH v3 10/20] fuse: set mapping error in writepage_locked when it fails

2017-04-25 Thread Jeff Layton
On Tue, 2017-04-25 at 13:19 +0200, Jan Kara wrote: > On Tue 25-04-17 06:35:13, Jeff Layton wrote: > > On Tue, 2017-04-25 at 10:17 +0200, Jan Kara wrote: > > > On Mon 24-04-17 13:14:36, Jeff Layton wrote: > > > > On Mon, 2017-04-24 at 18:04 +0200, Jan Kara wrote: >

[PATCH v3 19/20] jbd2: don't reset error in journal_finish_inode_data_buffers

2017-04-24 Thread Jeff Layton
Now that we don't clear writeback errors after fetching them, there is no need to reset them. This is also potentially racy. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/jbd2/commit.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/fs/jbd2/comm

[PATCH v3 15/20] mm: remove AS_EIO and AS_ENOSPC flags

2017-04-24 Thread Jeff Layton
They're no longer used. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- include/linux/pagemap.h | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 32512ffc15fa..9593eac41499 100644 --- a/include

[PATCH v3 14/20] fs: retrofit old error reporting API onto new infrastructure

2017-04-24 Thread Jeff Layton
t from other subsystem maintainers. I'm quite open to adding new API functions to help enable this if that would be helpful, but I don't really want to do that until I better understand what's needed. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- Documentation/filesy

[PATCH v3 12/20] lib: add errseq_t type and infrastructure for handling it

2017-04-24 Thread Jeff Layton
t was last bumped. Later patches will build on this infrastructure to change how writeback errors are tracked in the kernel. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- include/linux/errseq.h | 16 lib/Makefile | 2 +- lib/errseq.c

[PATCH v3 08/20] mm: ensure that we set mapping error if writeout() fails

2017-04-24 Thread Jeff Layton
If writepage fails during a page migration, then we need to ensure that fsync will see it by flagging the mapping. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- mm/migrate.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c

[PATCH v3 05/20] orangefs: don't call filemap_write_and_wait from fsync

2017-04-24 Thread Jeff Layton
Orangefs doesn't do buffered writes yet, so there's no point in initiating and waiting for writeback. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/orangefs/file.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c

[PATCH v3 07/20] nilfs2: set the mapping error when calling SetPageError on writeback

2017-04-24 Thread Jeff Layton
in the address space. Ensure that this is set in nilfs2. Cc: Ryusuke Konishi <konishi.ryus...@lab.ntt.co.jp> Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/nilfs2/segment.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index

[PATCH v3 06/20] dax: set errors in mapping when writeback fails

2017-04-24 Thread Jeff Layton
In order to get proper error codes from fsync, we must set an error in the mapping range when writeback fails. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/dax.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index 85abd741253d..9b6b04

[RFC xfstests PATCH] xfstests: add a writeback error handling test

2017-04-24 Thread Jeff Layton
on a separate device? Signed-off-by: Jeff Layton <jlay...@redhat.com> --- common/dmerror| 13 --- src/Makefile | 2 +- src/fsync-err.c | 102 ++ tests/generic/999 | 74 tests/g

[PATCH v3 09/20] 9p: set mapping error when writeback fails in launder_page

2017-04-24 Thread Jeff Layton
launder_page is just writeback under the page lock. We still need to mark the mapping for errors there when they occur. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/9p/vfs_addr.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_

[PATCH v3 04/20] fs: check for writeback errors after syncing out buffers in generic_file_fsync

2017-04-24 Thread Jeff Layton
these errors properly as well. With that, we don't need to twiddle it in ext2. Suggested-by: Jan Kara <j...@suse.cz> Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/ext2/file.c | 2 +- fs/libfs.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ext2/file

[PATCH v3 03/20] buffer: use mapping_set_error instead of setting the flag

2017-04-24 Thread Jeff Layton
Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: Jan Kara <j...@suse.cz> Reviewed-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 9196f2a270da..7063894106

[PATCH v3 17/20] cifs: cleanup writeback handling errors and comments

2017-04-24 Thread Jeff Layton
Now that writeback errors are handled on a per-file basis using the new sequence counter method at the vfs layer, we no longer need to re-set errors in the mapping after doing writeback in non-fsync codepaths. Also, fix up some bogus comments. Signed-off-by: Jeff Layton <jlay...@redhat.

[PATCH v3 16/20] mm: don't TestClearPageError in __filemap_fdatawait_range

2017-04-24 Thread Jeff Layton
subsystems, let's just rely on marking the address space when there are writeback errors. Change the TestClearPageError call to ClearPageError, and make __filemap_fdatawait_range a void return function. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- mm/filemap.c | 19 +---

[PATCH v3 18/20] mm: clean up error handling in write_one_page

2017-04-24 Thread Jeff Layton
Don't try to check PageError since that's potentially racy and not necessarily going to be set after writepage errors out. Instead, sample the mapping error early on, and use that value to tell us whether we got a writeback error since then. Signed-off-by: Jeff Layton <jlay...@redhat.

[PATCH v3 13/20] fs: new infrastructure for writeback error handling and reporting

2017-04-24 Thread Jeff Layton
. The new behavior is still consistent with the POSIX spec, and is more reliable for application developers. This patch just adds some basic infrastructure for doing this. Later patches will change the existing code to use this new infrastructure. Signed-off-by: Jeff Layton <jlay.

[PATCH v3 20/20] gfs2: clean up some filemap_* calls

2017-04-24 Thread Jeff Layton
-by: Jeff Layton <jlay...@redhat.com> --- fs/gfs2/glops.c | 12 fs/gfs2/lops.c | 4 +--- fs/gfs2/super.c | 6 ++ 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 5db59d444838..7362d19fdc4c 100644 --- a/fs/gfs2/glops.c ++

[PATCH v3 10/20] fuse: set mapping error in writepage_locked when it fails

2017-04-24 Thread Jeff Layton
This ensures that we see errors on fsync when writeback fails. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/fuse/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index ec238fb5a584..07d0efcb050c 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/

[PATCH v3 11/20] cifs: set mapping error when page writeback fails in writepage or launder_pages

2017-04-24 Thread Jeff Layton
Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/cifs/file.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 21d404535739..4b696a23b0b1 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2234,14 +2

[PATCH v3 00/20] fs: introduce new writeback error reporting and convert existing API as a wrapper around it

2017-04-24 Thread Jeff Layton
roversial and seem like reasonable bugfixes and cleanups. If any subsystem maintainers want to pick those up, then please do. After that, I'd like to get the larger changes into linux-next with an aim for merge in v4.13 or v4.14 (depending on how testing goes). Feedback is of course welcome! Jeff Layton

[PATCH v3 01/20] mm: drop "wait" parameter from write_one_page

2017-04-24 Thread Jeff Layton
an error here in some fashion. Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> Reviewed-by: Jan Kara <j...@suse.cz> Reviewed-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/exofs/dir.c| 2 +- fs/ext2/dir.c

[PATCH v3 02/20] mm: fix mapping_set_error call in me_pagecache_dirty

2017-04-24 Thread Jeff Layton
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 <jlay...@redhat.com> Reviewed-by: Ross Zwisler <

Re: [PATCH v3 10/20] fuse: set mapping error in writepage_locked when it fails

2017-04-25 Thread Jeff Layton
On Tue, 2017-04-25 at 10:17 +0200, Jan Kara wrote: > On Mon 24-04-17 13:14:36, Jeff Layton wrote: > > On Mon, 2017-04-24 at 18:04 +0200, Jan Kara wrote: > > > On Mon 24-04-17 09:22:49, Jeff Layton wrote: > > > > This ensures that we see errors on fsync when writeback

Re: [PATCH v4 13/27] lib: add errseq_t type and infrastructure for handling it

2017-05-10 Thread Jeff Layton
On Wed, 2017-05-10 at 08:03 +1000, NeilBrown wrote: > On Tue, May 09 2017, Jeff Layton wrote: > > > An errseq_t is a way of recording errors in one place, and allowing any > > number of "subscribers" to tell whether an error has been set again > > since a previo

[PATCH v4 13/27] lib: add errseq_t type and infrastructure for handling it

2017-05-09 Thread Jeff Layton
t was last bumped. Later patches will build on this infrastructure to change how writeback errors are tracked in the kernel. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- include/linux/errseq.h | 19 + lib/Makefile | 2 +- lib/errseq.c

Re: [PATCH v4 25/27] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-05-09 Thread Jeff Layton
On Tue, 2017-05-09 at 11:49 -0400, Jeff Layton wrote: > I waxed a little loquacious here, but I figured that more detail was > better, and writeback error handling is so hard to get right. > > Cc: Jan Kara <j...@suse.cz> > Signed-off-by: Jeff Layton <jlay...@redhat.com

[xfstests PATCH v2 1/3] generic: add a writeback error handling test

2017-05-09 Thread Jeff Layton
, but we can fill it out with other commands as necessary. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- common/dmerror| 13 +++-- src/Makefile | 2 +- src/fsync-err.c | 138 ++ tests/generic/999

[PATCH v4 26/27] mm: flesh out comments over mapping_set_error

2017-05-09 Thread Jeff Layton
Signed-off-by: Jeff Layton <jlay...@redhat.com> --- include/linux/pagemap.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 9593eac41499..9b453eae0aa1 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pag

[PATCH v4 08/27] dax: set errors in mapping when writeback fails

2017-05-09 Thread Jeff Layton
or if sync(2) gets called before fsync(2). So convert DAX to using standard error reporting through the mapping. Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: Jan Kara <j...@suse.cz> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-and-Tested-by: Ross

[PATCH v4 20/27] cifs: cleanup writeback handling errors and comments

2017-05-09 Thread Jeff Layton
Now that writeback errors are handled on a per-file basis using the new sequence counter method at the vfs layer, we no longer need to re-set errors in the mapping after doing writeback in non-fsync codepaths. Also, fix up some bogus comments. Signed-off-by: Jeff Layton <jlay...@redhat.

[PATCH v4 19/27] buffer: set errors in mapping at the time that the error occurs

2017-05-09 Thread Jeff Layton
that it's first detected. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/buffer.c | 19 +-- fs/gfs2/lops.c | 2 +- include/linux/buffer_head.h | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c

Re: [PATCH v4 14/27] fs: new infrastructure for writeback error handling and reporting

2017-05-10 Thread Jeff Layton
On Wed, 2017-05-10 at 13:48 +0200, Jan Kara wrote: > On Tue 09-05-17 11:49:17, Jeff Layton wrote: > > Most filesystems currently use mapping_set_error and > > filemap_check_errors for setting and reporting/clearing writeback errors > > at the mapping level. filemap_check

Re: [PATCH v4 13/27] lib: add errseq_t type and infrastructure for handling it

2017-05-10 Thread Jeff Layton
On Wed, 2017-05-10 at 07:18 -0700, Matthew Wilcox wrote: > On Tue, May 09, 2017 at 11:49:16AM -0400, Jeff Layton wrote: > > +++ b/lib/errseq.c > > @@ -0,0 +1,199 @@ > > +#include > > +#include > > +#include > > +#include > > + > > +/* >

[PATCH v4 21/27] mm: clean up error handling in write_one_page

2017-05-09 Thread Jeff Layton
Don't try to check PageError since that's potentially racy and not necessarily going to be set after writepage errors out. Instead, sample the mapping error early on, and use that value to tell us whether we got a writeback error since then. Signed-off-by: Jeff Layton <jlay...@redhat.

Re: [PATCH v4 15/27] fs: retrofit old error reporting API onto new infrastructure

2017-05-15 Thread Jeff Layton
On Mon, 2017-05-15 at 12:42 +0200, Jan Kara wrote: > On Tue 09-05-17 11:49:18, Jeff Layton wrote: > > Now that we have a better way to store and report errors that occur > > during writeback, we need to convert the existing codebase to use it. We > > could just adapt all o

[PATCH v4 25/27] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-05-09 Thread Jeff Layton
I waxed a little loquacious here, but I figured that more detail was better, and writeback error handling is so hard to get right. Cc: Jan Kara <j...@suse.cz> Signed-off-by: Jeff Layton <jlay...@redhat.com> --- Documentation/filesystems/vfs.txt | 54 ++

[PATCH v4 01/27] fs: remove unneeded forward definition of mm_struct from fs.h

2017-05-09 Thread Jeff Layton
Signed-off-by: Jeff Layton <jlay...@redhat.com> --- include/linux/fs.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 7251f7bb45e8..38adefd8e2a0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1252,8 +1252,6 @@ extern void f_

[PATCH v6 17/20] fs: add f_md_wb_err field to struct file for tracking metadata errors

2017-06-12 Thread Jeff Layton
Some filesystems keep a different mapping for metadata writeback. Add a second errseq_t to struct file for tracking metadata writeback errors. Also add a new function for checking a mapping of the caller's choosing vs. the f_md_wb_err value. Signed-off-by: Jeff Layton <jlay...@redhat.

[PATCH v6 09/20] fs: new infrastructure for writeback error handling and reporting

2017-06-12 Thread Jeff Layton
code to use this new infrastructure. Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: Jan Kara <j...@suse.cz> --- drivers/dax/device.c | 1 + fs/block_dev.c | 1 + fs/file_table.c | 1 + fs/open.c|

[PATCH v6 11/13] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-06-12 Thread Jeff Layton
.cz> Signed-off-by: Jeff Layton <jlay...@redhat.com> --- Documentation/filesystems/vfs.txt | 50 --- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index

[PATCH v6 12/20] fs: add a new fstype flag to indicate how writeback errors are tracked

2017-06-12 Thread Jeff Layton
.some code is shared between filesystems and needs to be able to handle both error tracking schemes. Add a new FS_WB_ERRSEQ flag to the fstype. Later patches will set and key off of that to decide what behavior should be used. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- includ

[xfstests PATCH v4 5/5] btrfs: make a btrfs version of writeback error reporting test

2017-06-12 Thread Jeff Layton
Make a new btrfs/999 test that works the way Chris Mason suggested: Build a filesystem with 2 devices that stripes the data across both devices, but mirrors metadata across both. Then, make one of the devices fail and see how fsync is handled. Signed-off-by: Jeff Layton <jlay...@redhat.

[PATCH v6 00/20] fs: enhanced writeback error reporting with errseq_t (pile #1)

2017-06-12 Thread Jeff Layton
on top of that. Jeff Layton (20): mm: fix mapping_set_error call in me_pagecache_dirty buffer: use mapping_set_error instead of setting the flag fs: check for writeback errors after syncing out buffers in generic_file_fsync buffer: set errors in mapping at the time that the error occurs

[PATCH v6 13/20] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-06-12 Thread Jeff Layton
Let's try to make this extra clear for fs authors. Also, although I think we'll eventually remove it once the transition is complete, I've gone ahead and documented the FS_WB_ERRSEQ flag as well. Cc: Jan Kara <j...@suse.cz> Signed-off-by: Jeff Layton <jlay...@redhat.com> --- D

[PATCH v6 18/20] ext4: use errseq_t based error handling for reporting data writeback errors

2017-06-12 Thread Jeff Layton
there is a metadata writeback failure. That's not ideal, but we can possibly improve upon it in the future. ext4 also has several calls to filemap_fdatawait and filemap_write_and_wait. Those will also be changed in a later patch to versions that use errseq_t based reporting. Signed-off-by: Jeff

[PATCH v6 15/20] fs: have call_fsync call filemap_report_wb_err if FS_WB_ERRSEQ is set

2017-06-12 Thread Jeff Layton
Allow filesystems to opt-in to a final check of wb_err if FS_WB_ERRSEQ is set. Technically, we could just plumb these calls into all of the fsync operations, but I think this means less code, changes and churn. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- include/linux/fs.

[PATCH v6 13/13] btrfs: minimal conversion to errseq_t writeback error reporting on fsync

2017-06-12 Thread Jeff Layton
Internal callers of filemap_* functions are left as-is. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/btrfs/file.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index da1096eb1a40..4632f16bc49c 100644 --- a/fs/btrfs/

[PATCH v6 12/13] xfs: minimal conversion to errseq_t writeback error reporting

2017-06-12 Thread Jeff Layton
Just check and advance the data errseq_t in struct file before before returning from fsync on normal files. Internal filemap_* callers are left as-is. We also set the FS_WB_ERRSEQ flag just for completeness sake. Not much is really using it at this point. Signed-off-by: Jeff Layton <j

[PATCH v6 20/20] btrfs: minimal conversion to errseq_t writeback error reporting on fsync

2017-06-12 Thread Jeff Layton
Set the FS_WB_ERRSEQ flag to opt-in to errseq_t based reporting. Internal call to filemap_* functions are left as-is. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/btrfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c

[PATCH v6 19/20] xfs: minimal conversion to errseq_t writeback error reporting

2017-06-12 Thread Jeff Layton
Just set the FS_WB_ERRSEQ flag to indicate that we want to use errseq_t based error reporting. Internal filemap_* calls are left as-is for now. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/xfs/xfs_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[PATCH v6 14/20] dax: set errors in mapping when writeback fails

2017-06-12 Thread Jeff Layton
rently cleared in the older code when writeback initiation fails, only when we discover an error after waiting on writeback to complete, so we only want to do this with errseq_t based error handling to prevent seeing duplicate errors on fsync. Signed-off-by: Jeff Layton <jlay...@redhat.com> Revi

[PATCH v6 16/20] block: convert to errseq_t based writeback error tracking

2017-06-12 Thread Jeff Layton
-by: Jeff Layton <jlay...@redhat.com> --- fs/block_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/block_dev.c b/fs/block_dev.c index 4d62fe771587..4bf865cc99de 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -801,6 +801,7 @@ static struct file_system_type bd_type = {

[PATCH v6 11/20] mm: set both AS_EIO/AS_ENOSPC and errseq_t in mapping_set_error

2017-06-12 Thread Jeff Layton
In later patches, we're going to want to convert many of these callers to check for errors since a well-defined point in time. For now, ensure that we can handle both sorts of checks by both setting errors in both places when there is a writeback failure. Signed-off-by: Jeff Layton <jlay.

[PATCH v6 08/20] lib: add errseq_t type and infrastructure for handling it

2017-06-12 Thread Jeff Layton
t was last bumped. Later patches will build on this infrastructure to change how writeback errors are tracked in the kernel. Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: NeilBrown <ne...@suse.com> Reviewed-by: Jan Kara <j...@suse.cz> --- include/linux/errseq

[xfstests PATCH v4 2/5] ext4: allow ext4 to use $SCRATCH_LOGDEV

2017-06-12 Thread Jeff Layton
the same thing when _scratch_mkfs is called. Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> --- common/rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/rc b/common/rc index 87e6ff08b18d..08807ac7c22a 100644 --- a/com

[xfstests PATCH v4 3/5] generic: test writeback error handling on dmerror devices

2017-06-12 Thread Jeff Layton
Ensure that we get an error back on all fds when a block device is open by multiple writers and writeback fails. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- tests/generic/998 | 64 +++ tests/generic/998.out | 2 ++ tests/generic

[xfstests PATCH v4 1/5] generic: add a writeback error handling test

2017-06-12 Thread Jeff Layton
, but we can fill it out with other commands as necessary. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- .gitignore | 1 + common/dmerror | 13 ++- doc/auxiliary-programs.txt | 16 src/Makefile | 2 +- src/dmerror

[xfstests PATCH v4 4/5] ext3: allow it to put journal on a separate device when doing scratch_mkfs

2017-06-12 Thread Jeff Layton
Signed-off-by: Jeff Layton <jlay...@redhat.com> --- common/rc | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 08807ac7c22a..46b890cbff6a 100644 --- a/common/rc +++ b/common/rc @@ -832,7 +832,16 @@ _scratch_mkfs() mk

[xfstests PATCH v4 0/5] new tests for writeback error reporting behavior

2017-06-12 Thread Jeff Layton
filesystems fail this test? Jeff Layton (5): generic: add a writeback error handling test ext4: allow ext4 to use $SCRATCH_LOGDEV generic: test writeback error handling on dmerror devices ext3: allow it to put journal on a separate device when doing scratch_mkfs btrfs: make a btrfs version

[PATCH v6 10/13] ext4: add more robust reporting of metadata writeback errors

2017-06-12 Thread Jeff Layton
metadata writeback errors are only tracked on a per-device level, this does mean that we'll end up reporting an error on all open file descriptors when there is a metadata writeback failure. That's not ideal, but we can possibly improve upon it in the future. Signed-off-by: Jeff Layton <j

[PATCH v6 07/20] mm: clean up error handling in write_one_page

2017-06-12 Thread Jeff Layton
Don't try to check PageError since that's potentially racy and not necessarily going to be set after writepage errors out. Instead, check the mapping for an error after writepage returns. Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: Jan Kara <j...@suse.cz>

[PATCH v6 10/20] mm: tracepoints for writeback error events

2017-06-12 Thread Jeff Layton
To enable that, make __errseq_set return the value that it was set to when we exit the loop. Take heed that that value is not suitable as a later "since" value, as it will not have been marked seen. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- include/linux/errse

[PATCH v6 02/20] buffer: use mapping_set_error instead of setting the flag

2017-06-12 Thread Jeff Layton
Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: Jan Kara <j...@suse.cz> Reviewed-by: Matthew Wilcox <mawil...@microsoft.com> Reviewed-by: Christoph Hellwig <h...@lst.de> --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/f

[PATCH v6 04/20] buffer: set errors in mapping at the time that the error occurs

2017-06-12 Thread Jeff Layton
that it's first detected. Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: Jan Kara <j...@suse.cz> --- fs/buffer.c | 20 +--- fs/gfs2/lops.c | 2 +- include/linux/buffer_head.h | 1 + 3 files changed, 15 insertions(+), 8 deletions(-)

[PATCH v6 05/20] mm: don't TestClearPageError in __filemap_fdatawait_range

2017-06-12 Thread Jeff Layton
across subsystems, let's just rely on marking the address space when there are writeback errors. Change the TestClearPageError call to ClearPageError, and make __filemap_fdatawait_range a void return function. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- mm/filemap.

[PATCH v6 01/20] mm: fix mapping_set_error call in me_pagecache_dirty

2017-06-12 Thread Jeff Layton
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 <jlay...@redhat.com> Reviewed-by: Ross Zwisler <

[PATCH v6 03/20] fs: check for writeback errors after syncing out buffers in generic_file_fsync

2017-06-12 Thread Jeff Layton
these errors properly as well. With that, we don't need to twiddle it in ext2. Suggested-by: Jan Kara <j...@suse.cz> Signed-off-by: Jeff Layton <jlay...@redhat.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Reviewed-by: Matthew Wilcox

Re: [PATCH v7 00/22] fs: enhanced writeback error reporting with errseq_t (pile #1)

2017-06-20 Thread Jeff Layton
On Tue, 2017-06-20 at 09:25 +1000, Stephen Rothwell wrote: > Hi Jeff, > > On Mon, 19 Jun 2017 12:23:46 -0400 Jeff Layton <jlay...@redhat.com> wrote: > > > > If there are no major objections to this set, I'd like to have > > linux-next start picking it up

Re: [PATCH v7 00/22] fs: enhanced writeback error reporting with errseq_t (pile #1)

2017-06-19 Thread Jeff Layton
On Fri, 2017-06-16 at 15:34 -0400, Jeff Layton wrote: > v7: > === > This is the seventh posting of the patchset to revamp the way writeback > errors are tracked and reported. > > The main difference from the v6 posting is the removal of the > FS_WB_ERRSEQ flag. That

Re: [PATCH v7 16/22] block: convert to errseq_t based writeback error tracking

2017-06-26 Thread Jeff Layton
On Sat, 2017-06-24 at 09:16 -0400, Jeff Layton wrote: > On Sat, 2017-06-24 at 04:59 -0700, Christoph Hellwig wrote: > > On Tue, Jun 20, 2017 at 01:44:44PM -0400, Jeff Layton wrote: > > > In order to query for errors with errseq_t, you need a previously- > > > sample

Re: [PATCH v7 16/22] block: convert to errseq_t based writeback error tracking

2017-06-24 Thread Jeff Layton
On Sat, 2017-06-24 at 04:59 -0700, Christoph Hellwig wrote: > On Tue, Jun 20, 2017 at 01:44:44PM -0400, Jeff Layton wrote: > > In order to query for errors with errseq_t, you need a previously- > > sampled point from which to check. When you call > > filemap_write_and_wait_r

Re: [PATCH v7 16/22] block: convert to errseq_t based writeback error tracking

2017-06-20 Thread Jeff Layton
ed point from which to check. When you call filemap_write_and_wait_range though you don't have a struct file and so no previously-sampled value. -- Jeff Layton <jlay...@redhat.com>

[PATCH v5 17/17] fs: convert ext2 to use write_one_page_since

2017-05-31 Thread Jeff Layton
Sample the wb_err before changing the directory, so that we can catch errors that occur since that point. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/ext2/dir.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c

[PATCH v5 07/17] mm: add filemap_fdatawait_range_since and filemap_write_and_wait_range_since

2017-05-31 Thread Jeff Layton
Add new filemap_*wait* variants that take a "since" value and return an error if one occurred since that sample point. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- include/linux/fs.h | 9 mm/filemap.c | 67 +++

[PATCH v5 11/17] fs: add f_md_wb_err field to struct file for tracking metadata errors

2017-05-31 Thread Jeff Layton
Some filesystems (particularly local ones) keep a different mapping for metadata writeback. Add a second errseq_t to struct file for tracking metadata writeback errors. Also add a new function for checking a mapping of the caller's choosing vs. the f_md_wb_err value. Signed-off-by: Jeff Layton

[PATCH v5 15/17] fs: add a write_one_page_since

2017-05-31 Thread Jeff Layton
Allow filesystems to pass in an errseq_t for a since value. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- include/linux/mm.h | 2 ++ mm/page-writeback.c | 53 + 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/i

[PATCH v5 13/17] jbd2: conditionally handle errors using errseq_t based on FS_WB_ERRSEQ flag

2017-05-31 Thread Jeff Layton
e since value to sync_blockdev_since. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/jbd2/commit.c | 29 +++-- fs/jbd2/recovery.c| 5 +++-- fs/jbd2/transaction.c | 1 + include/linux/jbd2.h | 3 +++ 4 files changed, 26 insertions(+), 12 deletions(-) d

[PATCH v5 09/17] block: convert to errseq_t based writeback error tracking

2017-05-31 Thread Jeff Layton
Fairly straightforward conversion. In fsync, just use the file->f_wb_err value as a "since" value. At the end, call filemap_report_wb_err to advance the cursor in it. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/block_dev.c | 13 ++--- 1 file changed,

[PATCH v5 10/17] block: add sync_blockdev_since and sync_filesystem_since

2017-05-31 Thread Jeff Layton
New variants of sync_filesystem and sync_blockdev. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/block_dev.c | 15 +++ fs/internal.h | 8 fs/sync.c | 45 + include/linux/fs.h | 13 - 4

[PATCH v5 14/17] ext4: convert to errseq_t based error tracking

2017-05-31 Thread Jeff Layton
d on a per-device level, this does mean that we'll end up reporting an error on all open file descriptors when there is a metadata writeback failure. Signed-off-by: Jeff Layton <jlay...@redhat.com> --- fs/ext4/dir.c | 8 ++-- fs/ext4/ext4.h| 8 fs/ext4/extents.c | 24

[PATCH v5 05/17] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-05-31 Thread Jeff Layton
.cz> Signed-off-by: Jeff Layton <jlay...@redhat.com> --- Documentation/filesystems/vfs.txt | 50 --- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index

  1   2   >