Re: [PATCH 03/34] net/ceph: convert put_page() to put_user_page*()

2019-08-02 Thread Jeff Layton
t; - } > + put_user_pages_dirty_lock(pages, num_pages, dirty); > kvfree(pages); > } > EXPORT_SYMBOL(ceph_put_page_vector); This patch looks sane enough. Assuming that the earlier patches are OK: Acked-by: Jeff Layton

Re: [PATCH v2 04/35] block: Use kmemdup rather than duplicating its implementation

2019-07-03 Thread Jeff Layton
cpy() is safe. >*/ > - memcpy(snap_names, &ondisk->snaps[snap_count], snap_names_len); > snaps = ondisk->snaps; > for (i = 0; i < snap_count; i++) { > snapc->snaps[i] = le64_to_cpu(snaps[i].id); Reviewed-by: Jeff Layton

[PATCH RESEND] loop: clear wb_err in bd_inode when detaching backing file

2018-05-21 Thread Jeff Layton
From: Jeff Layton When a loop block device encounters a writeback error, that error will get propagated to the bd_inode's wb_err field. If we then detach the backing file from it, attach another and fsync it, we'll get back the writeback error that we had from the previous backing file

Re: [PATCH] loop: clear wb_err in bd_inode when detaching backing file

2018-05-21 Thread Jeff Layton
On Mon, 2018-05-21 at 08:37 -0400, Jeff Layton wrote: > From: Jeff Layton > > When a loop block device encounters a writeback error, that error will > get propagated to the bd_inode's wb_err field. If we then detach the > backing file from it, attach another and fsync it

[PATCH] loop: clear wb_err in bd_inode when detaching backing file

2018-05-21 Thread Jeff Layton
From: Jeff Layton When a loop block device encounters a writeback error, that error will get propagated to the bd_inode's wb_err field. If we then detach the backing file from it, attach another and fsync it, we'll get back the writeback error that we had from the previous backing file

Re: [PATCH] fs: clear writeback errors in inode_init_always

2018-05-21 Thread Jeff Layton
lush or __loop_update_dio weren't called before we detach the device, it should still be possible to call fsync on the original fd and get back the error. As a side note, it looks like __loop_update_dio will discard an error from vfs_fsync, so certain ioctls against a loop device can cause errors to be lost. It seems like those ought to get propagated to userland or to the blockdev's mapping somehow. -- Jeff Layton

Re: write call hangs in kernel space after virtio hot-remove

2018-05-03 Thread Jeff Layton
e'll prevent dirtying of new pages when > we know the underlying device is gone. Because that will fix your problem > and also make sure user sees the IO errors directly instead of just in the > kernel log. The question is how to make this happen in the least painful > way. I think we could intercept writes in grab_cache_page_write_begin() > (which however requires that function to return a proper error code and not > just NULL / non-NULL). And we should also intercept write faults to not > allow page dirtying via mmap - probably somewhere in do_shared_fault() and > do_wp_page(). I've added Jeff to CC since he's dealing with IO error > handling a lot these days. Jeff, what do you think? > > Honza (cc'ing Willy too since he's given this more thought than me) For the record, I've mostly been looking at error _reporting_. Handling errors at this level is not something I've really considered in great detail as of yet. Still, I think the basic idea sounds reasonable. Not allowing pages to be dirtied when we can't clean them seems like a reasonable thing to do. The big question is how we'll report this to userland: Would your approach have it return an error on write() and such? What sort of error if so? ENODEV? Would we have to SIGBUS when someone tries to dirty the page through mmap? -- Jeff Layton

Re: [LSF/MM] schedule suggestion

2018-04-19 Thread Jeff Layton
On Thu, 2018-04-19 at 13:26 -0400, Jerome Glisse wrote: > On Thu, Apr 19, 2018 at 12:58:39PM -0400, Jeff Layton wrote: > > On Thu, 2018-04-19 at 12:30 -0400, Jerome Glisse wrote: > > > On Thu, Apr 19, 2018 at 07:43:56AM -0700, Matthew Wilcox wrote: > > > > On Thu, Ap

Re: [LSF/MM] schedule suggestion

2018-04-19 Thread Jeff Layton
dded to the files_struct. Those are generally shared with other threads within the same process. The files_struct can also be shared with other processes if you clone() with the right flags. Doing something per-thread on every open may be rather difficult to do. -- Jeff Layton

Re: [PATCH 00/11] fs: use freeze_fs on suspend/hibernate

2017-12-01 Thread Jeff Layton
ze_fs can then just have the engine stop parking RPCs and wake up the waitq. That should be enough to make suspend and resume work more reliably. If, however, you're interested in making the cgroup freezer also work, then we may need to do a bit more work to ensure that we don't end up with frozen tasks squatting on VFS locks. -- Jeff Layton

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

2017-06-30 Thread Jeff Layton
onversion 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 here? -- Jeff Layton

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 18:21 +, Matthew Wilcox wrote: > From: Jeff Layton [mailto:jlay...@poochiereds.net] > > 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: > > > > +Ha

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 > > > > Just check and advance the errseq_t in the file before returning. > > Internal callers of filemap

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

2017-06-29 Thread Jeff Layton
ent it 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

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 > > > > ext2 currently does a test+clear of the AS_EIO flag, which is > > is problematic for some coming changes. &

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 > > > > Let's try to make this extra clear for fs authors. > > > > Cc: Jan Kara > > Signed-off

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 > > Most filesystems currently use mapping_set_error and > filemap_check_errors for setting and reporting/clearing writeback errors > at the mapping level. filemap_check_errors is indirectly called

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 > > Most filesystems currently use mapping_set_error and > filemap_check_errors for setting and reporting/clearing writeback errors > at the mapping level. filemap_check_errors is indirectly called

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
sly- sampled 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

Re: [PATCH v7 11/22] fs: new infrastructure for writeback error handling and reporting

2017-06-20 Thread Jeff Layton
struct address_space *mapping, > > errseq_t since) > > Overly long line here (the patch has a few more) > Ok, I'll fix those up. -- Jeff Layton

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 wrote: > > > > If there are no major objections to this set, I'd like to have > > linux-next start picking it up to get some wider testing.

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 15/22] dax: set errors in mapping when writeback fails

2017-06-17 Thread Jeff Layton
On Fri, 2017-06-16 at 15:34 -0400, Jeff Layton wrote: > Jan Kara's description for this patch is much better than mine, so I'm > quoting it verbatim here: > > DAX currently doesn't set errors in the mapping when cache flushing > fails in dax_writeback_mapping_range(

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

2017-06-16 Thread Jeff Layton
hrowing I/O errors, and then test the how the filesystem layer reports errors after that. Jeff Layton (22): fs: remove call_fsync helper function buffer: use mapping_set_error instead of setting the flag fs: check for writeback errors after syncing out buffers in generic_file_fsync buffe

[PATCH v7 01/22] fs: remove call_fsync helper function

2017-06-16 Thread Jeff Layton
Requested-by: Christoph Hellwig Signed-off-by: Jeff Layton --- fs/sync.c | 2 +- include/linux/fs.h | 6 -- ipc/shm.c | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/sync.c b/fs/sync.c index 11ba023434b1..2a54c1f22035 100644 --- a/fs/sync.c +++ b

[PATCH v7 07/22] mm: don't TestClearPageError in __filemap_fdatawait_range

2017-06-16 Thread Jeff Layton
consistent 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 --- mm/filemap.c | 20 +--- 1

[PATCH v7 14/22] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-06-16 Thread Jeff Layton
Let's try to make this extra clear for fs authors. Cc: Jan Kara Signed-off-by: Jeff Layton --- Documentation/filesystems/vfs.txt | 43 --- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/vfs.txt b/Document

[PATCH v7 11/22] fs: new infrastructure for writeback error handling and reporting

2017-06-16 Thread Jeff Layton
will change the existing code to use this new infrastructure for reporting errors at fsync time. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- drivers/dax/device.c | 1 + fs/block_dev.c | 1 + fs/file_table.c | 1 + fs/open.c

[PATCH v7 13/22] mm: set both AS_EIO/AS_ENOSPC and errseq_t in mapping_set_error

2017-06-16 Thread Jeff Layton
or occurs. 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 L

[xfstests PATCH v5 3/5] generic: add a writeback error handling test

2017-06-16 Thread Jeff Layton
ilesystems, and eventually make it a more general test. Signed-off-by: Jeff Layton --- .gitignore | 1 + common/dmerror | 13 ++- doc/auxiliary-programs.txt | 16 src/Makefile | 4 +- src/dmerror| 44 + src/fsync-err.c

[PATCH v7 22/22] btrfs: minimal conversion to errseq_t writeback error reporting on fsync

2017-06-16 Thread Jeff Layton
Just check and advance the errseq_t in the file before returning. Internal callers of filemap_* functions are left as-is. Signed-off-by: Jeff Layton --- 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

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

2017-06-16 Thread Jeff Layton
Mason Signed-off-by: Jeff Layton --- tests/btrfs/999 | 94 + tests/btrfs/999.out | 3 ++ tests/btrfs/group | 1 + 3 files changed, 98 insertions(+) create mode 100755 tests/btrfs/999 create mode 100644 tests/btrfs/999.out diff --git a

[xfstests PATCH v5 4/5] generic: test writeback error handling on dmerror devices

2017-06-16 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 --- tests/generic/998 | 63 +++ tests/generic/998.out | 2 ++ tests/generic/group | 1 + 3 files

[PATCH v7 19/22] ext4: add more robust reporting of metadata writeback errors

2017-06-16 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 Layto

[PATCH v7 15/22] dax: set errors in mapping when writeback fails

2017-06-16 Thread Jeff Layton
pen against the file 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 Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Reviewed-and-Tested-by: Ross Zwisler --- fs/dax.c | 4 +++- 1 file changed, 3 i

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

2017-06-16 Thread Jeff Layton
ue in the mapping. Note that there are internal callers that call sync_blockdev and the like that are not affected by this. They'll continue to use the AS_EIO/AS_ENOSPC flags for error reporting like they always have for now. Signed-off-by: Jeff Layton --- fs/block_dev.c | 8 ++-- 1 file

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

2017-06-16 Thread Jeff Layton
Signed-off-by: Jeff Layton --- common/rc | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 57001b47a8b7..43e160e91360 100644 --- a/common/rc +++ b/common/rc @@ -840,7 +840,16 @@ _scratch_mkfs() mkfs_cmd="$MKFS_BTRFS

[PATCH v7 18/22] fs: add f_md_wb_err field to struct file for tracking metadata errors

2017-06-16 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 --- include/linux

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

2017-06-16 Thread Jeff Layton
block devices and one test for btrfs. The tests work with dmerror to make data writeback from the pagecache fail, and then tests how the kernel reports errors afterward. xfs, ext2/3/4 and btrfs all pass on a kernel with the patchset above. "Bare" block devices also work correctly.

[PATCH v7 21/22] xfs: minimal conversion to errseq_t writeback error reporting

2017-06-16 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. Signed-off-by: Jeff Layton --- fs/xfs/xfs_file.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/xfs

[xfstests PATCH v5 1/5] ext4: allow ext4 to use $SCRATCH_LOGDEV

2017-06-16 Thread Jeff Layton
o the same thing when _scratch_mkfs is called. Signed-off-by: Jeff Layton Reviewed-by: Darrick J. Wong --- common/rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/rc b/common/rc index ff1b75c9cd25..57001b47a8b7 100644 --- a/common/rc +++ b/common/rc @@ -679,6 +

[PATCH v7 17/22] ext4: use errseq_t based error handling for reporting data writeback errors

2017-06-16 Thread Jeff Layton
. That will be added in a later patch. Signed-off-by: Jeff Layton --- fs/ext4/fsync.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index 9d549608fd30..03d6259d8662 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -100,8

[PATCH v7 20/22] ext2: convert to errseq_t based writeback error tracking

2017-06-16 Thread Jeff Layton
Set the flag to indicate that we want new-style data writeback error handling. This means that we need to override the open routines for files and directories so that we can sample the bdev wb_err at open. Signed-off-by: Jeff Layton --- fs/ext2/dir.c | 8 fs/ext2/file.c | 26

[PATCH v7 10/22] lib: add errseq_t type and infrastructure for handling it

2017-06-16 Thread Jeff Layton
nce it 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 Reviewed-by: NeilBrown Reviewed-by: Jan Kara --- include/linux/errseq.h | 19 + lib/Makefile | 2 +- lib/errseq.c

[PATCH v7 12/22] mm: tracepoints for writeback error events

2017-06-16 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 --- include/linux/errseq.h | 2 +- include/

[PATCH v7 08/22] mm: clean up error handling in write_one_page

2017-06-16 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 Reviewed-by: Jan Kara --- mm/page-writeback.c | 15 +++--

[PATCH v7 09/22] fs: always sync metadata in __generic_file_fsync

2017-06-16 Thread Jeff Layton
lways attempting to write out the metadata, even when a flush of the data reports an error. Signed-off-by: Jeff Layton --- fs/libfs.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index 1dec90819366..c93e77ecb49c 100644 --- a/fs/libfs.c +++

[PATCH v7 06/22] mm: clear AS_EIO/AS_ENOSPC when writeback initiation fails

2017-06-16 Thread Jeff Layton
s an error. Signed-off-by: Jeff Layton --- mm/filemap.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/mm/filemap.c b/mm/filemap.c index 37f286df7c95..c349a5d3a34b 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -517,6 +517,9 @@ int filemap_write_and_wait(struct address_spac

[PATCH v7 05/22] jbd2: don't clear and reset errors after waiting on writeback

2017-06-16 Thread Jeff Layton
Resetting this flag is almost certainly racy, and will be problematic with some coming changes. Make filemap_fdatawait_keep_errors return int, but not clear the flag(s). Have jbd2 call it instead of filemap_fdatawait and don't attempt to re-set the error flag if it fails. Signed-off-by:

[PATCH v7 02/22] buffer: use mapping_set_error instead of setting the flag

2017-06-16 Thread Jeff Layton
Signed-off-by: Jeff Layton Reviewed-by: Jan Kara Reviewed-by: Matthew Wilcox Reviewed-by: Christoph Hellwig --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 44172d11efae..7b4f4bfde91e 100644 --- a/fs/buffer.c +++ b/fs/buffer.c

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

2017-06-16 Thread Jeff Layton
errors properly as well. With that, we don't need to twiddle it in ext2. Suggested-by: Jan Kara Signed-off-by: Jeff Layton Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Matthew Wilcox --- fs/ext2/file.c | 2 +- fs/libfs.c | 3 ++- 2 files changed, 3 insertions(

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

2017-06-16 Thread Jeff Layton
that it's first detected. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/buffer.c | 20 +--- fs/gfs2/lops.c | 2 +- include/linux/buffer_head.h | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/fs/buffer.c b/fs/buff

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

2017-06-15 Thread Jeff Layton
On Thu, 2017-06-15 at 07:57 -0700, Christoph Hellwig wrote: > On Thu, Jun 15, 2017 at 06:42:12AM -0400, Jeff Layton wrote: > > Correct. > > > > But if there is a data writeback error, should we report an error on all > > open fds at that time (like we will for fsync

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

2017-06-15 Thread Jeff Layton
On Thu, 2017-06-15 at 01:22 -0700, Christoph Hellwig wrote: > On Wed, Jun 14, 2017 at 01:24:43PM -0400, Jeff Layton wrote: > > In this smaller set, it's only really used for DAX. > > DAX only is implemented by three filesystems, please just fix them > up in one go. >

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

2017-06-14 Thread Jeff Layton
On Tue, 2017-06-13 at 23:47 -0700, Christoph Hellwig wrote: > On Tue, Jun 13, 2017 at 06:24:32AM -0400, Jeff Layton wrote: > > That's definitely what I want for the endgame here. My plan was to add > > this flag for now, and then eventually reverse it (or drop it) once all >

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

2017-06-14 Thread Jeff Layton
On Tue, 2017-06-13 at 16:40 +0800, Eryu Guan wrote: > On Mon, Jun 12, 2017 at 08:42:13AM -0400, Jeff Layton wrote: > > 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 de

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

2017-06-13 Thread Jeff Layton
On Tue, 2017-06-13 at 16:32 +0800, Eryu Guan wrote: > On Mon, Jun 12, 2017 at 08:42:08AM -0400, Jeff Layton wrote: > > v4: respin set based on Eryu's comments > > > > These tests are companion tests to the patchset I recently posted with > > the cover letter:

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

2017-06-13 Thread Jeff Layton
On Mon, 2017-06-12 at 21:30 -0700, Darrick J. Wong wrote: > On Mon, Jun 12, 2017 at 08:23:15AM -0400, Jeff Layton wrote: > > 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. > &g

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

2017-06-13 Thread Jeff Layton
On Mon, 2017-06-12 at 05:45 -0700, Christoph Hellwig wrote: > On Mon, Jun 12, 2017 at 08:23:06AM -0400, Jeff Layton wrote: > > 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. > > Please invert t

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

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

[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 --- tests/btrfs/999

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

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

[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 --- 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() mkfs_cmd="$MKFS_BTRFS

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

2017-06-12 Thread Jeff Layton
just let unconverted 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: mak

[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 --- tests/generic/998 | 64 +++ tests/generic/998.out | 2 ++ tests/generic/group | 1 + 3 files

[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 --- include/linux/errseq.h | 2 +- include/

[PATCH v6 06/20] mm: drop "wait" parameter from write_one_page

2017-06-12 Thread Jeff Layton
an error here in some fashion. Signed-off-by: Jeff Layton Reviewed-by: Ross Zwisler Reviewed-by: Jan Kara Reviewed-by: Matthew Wilcox Reviewed-by: Christoph Hellwig --- fs/exofs/dir.c| 2 +- fs/ext2/dir.c | 2 +- fs/jfs/jfs_metapage.c | 4 ++-- fs/minix/dir.c| 2

[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 Reviewed-by: Jan Kara Reviewed-by: Matthew Wilcox Reviewed-by: Christoph Hellwig --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 161be58c5cb0..4be8b914a222 100644 --- a/fs/buffer.c +++ b/fs/buffer.c

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

2017-06-12 Thread Jeff Layton
consistent 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 --- mm/filemap.c | 20 +--- 1

[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 Reviewed-by: Ross Zwisler Reviewed-by: Jan Kara Reviewed-by: Ma

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

2017-06-12 Thread Jeff Layton
errors properly as well. With that, we don't need to twiddle it in ext2. Suggested-by: Jan Kara Signed-off-by: Jeff Layton Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Matthew Wilcox --- fs/ext2/file.c | 2 +- fs/libfs.c | 3 ++- 2 files changed, 3 insertions(

[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 Reviewed-by: Jan Kara --- fs/buffer.c | 20 +--- fs/gfs2/lops.c | 2 +- include/linux/buffer_head.h | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/fs/buffer.c b/fs/buff

[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 --- include/linux/fs.h | 1 + 1 file

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

2017-06-12 Thread Jeff Layton
or occurs. 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 L

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

2017-06-12 Thread Jeff Layton
nce it 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 Reviewed-by: NeilBrown Reviewed-by: Jan Kara --- include/linux/errseq.h | 19 + lib/Makefile | 2 +- lib/errseq.c

[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 --- include/linux

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

2017-06-12 Thread Jeff Layton
will change the existing code to use this new infrastructure. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- drivers/dax/device.c | 1 + fs/block_dev.c | 1 + fs/file_table.c | 1 + fs/open.c| 3 +++ include/linux/fs.h | 53 ++

[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 --- fs/xfs

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

2017-06-12 Thread Jeff Layton
ags are not currently 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 Reviewed-by:

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

2017-06-12 Thread Jeff Layton
ff-by: Jeff Layton --- 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 = { .name =

[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 Signed-off-by: Jeff Layton --- Documentation/filesyste

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

2017-06-12 Thread Jeff Layton
when 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-of

[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 --- 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/file.c +++ b/fs/btrfs/file.c

[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 --- include/linux/fs.h | 20 ++-- 1 file

[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 --- fs/btrfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 4f1cdd5058f1

[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 --- fs/xfs/xfs_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs

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

2017-06-12 Thread Jeff Layton
Signed-off-by: Jeff Layton --- 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 f42b90687d40..c3efdd833a3d 100644 --- a/Doc

[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 Layto

[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 Reviewed-by: Jan Kara --- mm/page-writeback.c | 15 +++--

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

2017-06-12 Thread Jeff Layton
behavior of the filesystem layer 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 mappin

Re: [xfstests PATCH v3 5/5] btrfs: allow it to use $SCRATCH_LOGDEV

2017-06-08 Thread Jeff Layton
On Tue, 2017-06-06 at 17:19 +0800, Eryu Guan wrote: > On Wed, May 31, 2017 at 09:08:20AM -0400, Jeff Layton wrote: > > With btrfs, we can't really put the log on a separate device. What we > > can do however is mirror the metadata across two devices and make the > > data

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

2017-06-06 Thread Jeff Layton
On Tue, 2017-06-06 at 10:17 -0700, Darrick J. Wong wrote: > On Tue, Jun 06, 2017 at 08:23:25PM +0800, Eryu Guan wrote: > > On Tue, Jun 06, 2017 at 06:15:57AM -0400, Jeff Layton wrote: > > > On Tue, 2017-06-06 at 16:58 +0800, Eryu Guan wrote: > > > > On Wed, May 31,

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

2017-06-06 Thread Jeff Layton
On Tue, 2017-06-06 at 16:58 +0800, Eryu Guan wrote: > On Wed, May 31, 2017 at 09:08:16AM -0400, Jeff Layton wrote: > > I'm working on a set of kernel patches to change how writeback errors > > are handled and reported in the kernel. Instead of reporting a > > writeba

Re: [PATCH v5 08/17] dax: set errors in mapping when writeback fails

2017-06-05 Thread Jeff Layton
On Mon, 2017-06-05 at 19:01 -0600, Ross Zwisler wrote: > On Wed, May 31, 2017 at 08:45:31AM -0400, Jeff Layton wrote: > > Jan's description for this patch is much better than mine, so I'm > > quoting it verbatim here: > > > > -8<---

Re: [PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it

2017-06-02 Thread Jeff Layton
On Thu, 2017-06-01 at 23:25 -0600, Ross Zwisler wrote: > On Wed, May 31, 2017 at 08:45:23AM -0400, Jeff Layton wrote: > > v5: don't retrofit old API over the new infrastructure > > add fstype flag to indicate how wb errors are tracked within that fs > > add more f

Re: [PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it

2017-05-31 Thread Jeff Layton
On Wed, 2017-05-31 at 14:37 -0700, Andrew Morton wrote: > On Wed, 31 May 2017 17:31:49 -0400 Jeff Layton wrote: > > > On Wed, 2017-05-31 at 13:27 -0700, Andrew Morton wrote: > > > On Wed, 31 May 2017 08:45:23 -0400 Jeff Layton wrote: > > > > > > >

Re: [PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it

2017-05-31 Thread Jeff Layton
On Wed, 2017-05-31 at 13:27 -0700, Andrew Morton wrote: > On Wed, 31 May 2017 08:45:23 -0400 Jeff Layton wrote: > > > This is v5 of the patchset to improve how we're tracking and reporting > > errors that occur during pagecache writeback. > > I'm curious to

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

2017-05-31 Thread Jeff Layton
On Wed, 2017-05-31 at 11:59 -0700, Eduardo Valentin wrote: > Hello, > > On Wed, May 31, 2017 at 09:08:16AM -0400, Jeff Layton wrote: > > I'm working on a set of kernel patches to change how writeback errors > > are handled and reported in the kernel. Instead of reportin

  1   2   >