[PATCH 1/1] fs: global sync to not clear error status of individual inodes

2015-09-15 Thread Junichi Nomura
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_fd

Re: [PATCH 1/1] fs: global sync to not clear error status of individual inodes

2015-09-15 Thread Andi Kleen
> This patch adds filemap_fdatawait_keep_errors() for call sites where > writeback error is not handled so that they don't clear error status. Patch looks good to me. Acked-by: Andi Kleen -Andi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message

Re: [PATCH 1/1] fs: global sync to not clear error status of individual inodes

2015-09-15 Thread Tejun Heo
Hello, Junichi. On Tue, Sep 15, 2015 at 09:54:13AM +, 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

Re: [PATCH 1/1] fs: global sync to not clear error status of individual inodes

2015-09-15 Thread Andi Kleen
> Is this an actual problem? Write errors usually indicate that the There are transaction systems that need to track errors at the level of the individual IO. So yes we should guarantee that if a particular sync failed an error is always returned. -Andi -- To unsubscribe from this list: send th

Re: [PATCH 1/1] fs: global sync to not clear error status of individual inodes

2015-09-15 Thread Andrew Morton
On Tue, 15 Sep 2015 16:37:24 +0200 Andi Kleen wrote: > > This patch adds filemap_fdatawait_keep_errors() for call sites where > > writeback error is not handled so that they don't clear error status. > > Patch looks good to me. > Me too. It would be nice to capture the test case(s) somewhere

Re: [PATCH 1/1] fs: global sync to not clear error status of individual inodes

2015-09-15 Thread Junichi Nomura
On 09/16/15 07:02, Andrew Morton wrote: > It would be nice to capture the test case(s) somewhere permanent. > Possibly in tools/testing/selftests, but selftests is more for peculiar > linux-specific things. LTP or xfstests would be a better place. I'll check xfstests if I can adapt the test case

Re: [PATCH 1/1] fs: global sync to not clear error status of individual inodes

2015-09-15 Thread Junichi Nomura
On 09/16/15 00:20, Tejun Heo wrote: >> @@ -2121,7 +2121,13 @@ static void wait_sb_inodes(struct super_block *sb) >> iput(old_inode); >> old_inode = inode; >> >> -filemap_fdatawait(mapping); >> +/* >> + * Wait for on-going writeback to