Re: [f2fs-dev] [PATCH] f2fs: split bio cache

2017-05-09 Thread Chao Yu
On 2017/5/9 9:49, Chao Yu wrote: > Hi Jaegeuk, > > On 2017/5/9 5:23, Jaegeuk Kim wrote: >> Hi Chao, >> >> I can't see a strong reason to split meta from data/node and rename the >> existing >> function names. Instead, how about keeping the existing one while adding some >> page types to deal with

Re: [f2fs-dev] [PATCH] f2fs: fix BG_GC count stat

2017-05-09 Thread Jaegeuk Kim
On 05/09, Weichao Guo wrote: > We should call stat_inc_bggc_count only after BG_GC has been performed > successfully. Otherwise, BG_GC count may be larger than total count > when f2fs_gc failed, e.g., no victim was selected. BTW, if we do this, we can't monitor the call count of BGGC. Actually we

Re: [f2fs-dev] [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 > Signed-off-by: Jeff Layton > --- > Documentation/filesystems/vfs.txt | 54 > ++

[f2fs-dev] [xfstests PATCH v2 3/3] btrfs: allow it to use $SCRATCH_LOGDEV

2017-05-09 Thread Jeff Layton
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 put the data on a single device. When we turn on dmerror then the metadata can fall back to using the other mirror while the data errors out. Signed-off-by: Jeff Layto

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

2017-05-09 Thread Jeff Layton
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 writeback error to only the first fsync caller on the file, I aim to make the kernel report them once on every file description. This patch adds a test for the new b

[f2fs-dev] [xfstests PATCH v2 0/3] xfstest for updated writeback error handling

2017-05-09 Thread Jeff Layton
I've numbered the new test as 999 for the moment so as not to collide with tests being added while I've been working on this. I can change that and resend if this should go in. I'm working on a set of kernel patches to change how writeback errors are handled and reported in the kernel. Instead of

[f2fs-dev] [xfstests PATCH v2 2/3] ext4: allow ext4 to use $SCRATCH_LOGDEV

2017-05-09 Thread Jeff Layton
The writeback error handling test requires that you put the journal on a separate device. This allows us to use dmerror to simulate data writeback failure, without affecting the journal. xfs already has infrastructure for this (a'la $SCRATCH_LOGDEV), so wire up the ext4 code so that it can do the

[f2fs-dev] [SPAM] motorbike brake pad info

2017-05-09 Thread kian
Hi We can supply high quality motorcycle brake pad in sintered material and semi-metallic We have good quality material and cheaper prices if you have any requirment,you can click our website :www.tracyelise.com Thanks best regards Motodios Limited kian

[f2fs-dev] [PATCH v4 27/27] mm: clean up comments in me_pagecache_dirty

2017-05-09 Thread Jeff Layton
This no longer applies with the new writeback error tracking and reporting infrastructure. Signed-off-by: Jeff Layton --- mm/memory-failure.c | 35 +-- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 4

[f2fs-dev] [PATCH v4 22/27] jbd2: don't reset error in journal_finish_inode_data_buffers

2017-05-09 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 --- fs/jbd2/commit.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c inde

[f2fs-dev] [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 Signed-off-by: Jeff Layton --- Documentation/filesystems/vfs.txt | 54 --- 1 file changed, 45 insertions(+), 9 dele

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

2017-05-09 Thread Jeff Layton
Signed-off-by: Jeff Layton --- 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/pagemap.h @@ -27,6 +27,20 @@ enum

[f2fs-dev] [PATCH v4 23/27] gfs2: clean up some filemap_* calls

2017-05-09 Thread Jeff Layton
In some places, it's trying to reset the mapping error after calling filemap_fdatawait. That's no longer required. Also, turn several filemap_fdatawrite+filemap_fdatawait calls into filemap_write_and_wait. That will at least return writeback errors that occur during the write phase. Signed-off-by:

[f2fs-dev] [PATCH v4 24/27][RFC] nfs: convert to new errseq_t based error tracking for writeback errors

2017-05-09 Thread Jeff Layton
Drop the ERROR_WRITE flag and convert the error field in the context to a errseq_t. Add a new wb_err_cursor to track the reporting of the errseq_t. In principle, we could use the f_wb_err field in struct file for that, but that's problematic with the stock reporting in call_fsync. Signed-off-by: J

[f2fs-dev] [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 --- fs/cifs/cifsfs.c |

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

2017-05-09 Thread Jeff Layton
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 previous time. It's implemented as an unsigned 32-bit value that is managed with atomic operations. The low order bits are designated to hold an error

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

2017-05-09 Thread 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 from most of the filemap_fdatawait_* functions and from filemap_write_and_wait*. These functions are called f

[f2fs-dev] [PATCH v4 11/27] fuse: set mapping error in writepage_locked when it fails

2017-05-09 Thread Jeff Layton
This ensures that we see errors on fsync when writeback fails. Signed-off-by: Jeff Layton Reviewed-by: Christoph Hellwig --- 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/f

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

2017-05-09 Thread Jeff Layton
I noticed on xfs that I could still sometimes get back an error on fsync on a fd that was opened after the error condition had been cleared. The problem is that the buffer code sets the write_io_error flag and then later checks that flag to set the error in the mapping. That flag perisists for qui

[f2fs-dev] [PATCH v4 18/27] mm: don't TestClearPageError in __filemap_fdatawait_range

2017-05-09 Thread Jeff Layton
The -EIO returned here can end up overriding whatever error is marked in the address space, and be returned at fsync time, even when there is a more appropriate error stored in the mapping. Read errors are also sometimes tracked on a per-page level using PG_error. Suppose we have a read error on a

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

2017-05-09 Thread Jeff Layton
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 of the filesystem code and related infrastructure to the new API, but that's a lot of churn. When it comes to setting errors in the mapp

[f2fs-dev] [PATCH v4 17/27] mm: remove AS_EIO and AS_ENOSPC flags

2017-05-09 Thread Jeff Layton
They're no longer used. Signed-off-by: Jeff Layton --- 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/linux/pagemap.h +++ b/include/linu

[f2fs-dev] [PATCH v4 16/27] fs: adapt sync_file_range to new reporting infrastructure

2017-05-09 Thread Jeff Layton
Since it returns errors in a way similar to fsync, have it use the same method for returning previously-reported writeback errors. Signed-off-by: Jeff Layton --- fs/sync.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fs/sync.c b/fs/sync.c index 11ba023434b1..

[f2fs-dev] [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 --- mm/page-writeback.c |

[f2fs-dev] [PATCH v4 09/27] nilfs2: set the mapping error when calling SetPageError on writeback

2017-05-09 Thread Jeff Layton
In a later patch, we're going to want to make the fsync codepath not do a TestClearPageError call as that can override the error set in the address space. To do that though, we need to ensure that filesystems that are relying on the PG_error bit for reporting writeback errors also set an error in t

[f2fs-dev] [PATCH v4 12/27] cifs: set mapping error when page writeback fails in writepage or launder_pages

2017-05-09 Thread Jeff Layton
Signed-off-by: Jeff Layton Reviewed-by: Christoph Hellwig --- fs/cifs/file.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 21d404535739..0bee7f8d91ad 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2234,14 +2234,16 @@

[f2fs-dev] [PATCH v4 05/27] btrfs: btrfs_wait_tree_block_writeback can be void return

2017-05-09 Thread Jeff Layton
Nothing checks its return value. Signed-off-by: Jeff Layton --- fs/btrfs/disk-io.c | 6 +++--- fs/btrfs/disk-io.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index eb1ee7b6f532..8c479bd5534a 100644 --- a/fs/btrfs/disk-io.c +++ b/

[f2fs-dev] [PATCH v4 10/27] 9p: set mapping error when writeback fails in launder_page

2017-05-09 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 Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig --- fs/9p/vfs_addr.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/f

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

2017-05-09 Thread Jeff Layton
Jan'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(). Since this function can get called only from fsync(2) or sync(2), this is actually as good as it c

[f2fs-dev] [PATCH v4 00/27] fs: introduce new writeback error reporting and convert existing API as a wrapper around it

2017-05-09 Thread Jeff Layton
v4: several more cleanup patches documentation and kerneldoc comment updates fix bugs in gfs2 patches make sync_file_range use same error reporting semantics bugfixes in buffer.c convert nfs to new scheme (maybe bogus, can be dropped) v3: wb_err_t -> errseq_t conversion cle

[f2fs-dev] [PATCH v4 07/27] orangefs: don't call filemap_write_and_wait from fsync

2017-05-09 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 Reviewed-by: Christoph Hellwig Acked-by: Mike Marshall --- fs/orangefs/file.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/orangefs/fil

[f2fs-dev] [PATCH v4 06/27] fs: check for writeback errors after syncing out buffers in generic_file_fsync

2017-05-09 Thread Jeff Layton
ext2 currently does a test+clear of the AS_EIO flag, which is is problematic for some coming changes. What we really need to do instead is call filemap_check_errors in __generic_file_fsync after syncing out the buffers. That will be sufficient for this case, and help other callers detect these err

[f2fs-dev] [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 --- 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_delown(struct file *filp);

[f2fs-dev] [PATCH v4 04/27] buffer: use mapping_set_error instead of setting the flag

2017-05-09 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 9196f2a270da..70638941066d 100644 --- a/fs/buffer.c +++ b/fs/buffer.c

[f2fs-dev] [PATCH v4 02/27] mm: drop "wait" parameter from write_one_page

2017-05-09 Thread Jeff Layton
The callers all set it to 1. Also, make it clear that this function will not set any sort of AS_* error, and that the caller must do so if necessary. No existing caller uses this on normal files, so none of them need it. Also, add __must_check here since, in general, the callers need to handle an

[f2fs-dev] [PATCH v4 03/27] mm: fix mapping_set_error call in me_pagecache_dirty

2017-05-09 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: Matthew

Re: [f2fs-dev] [RFC xfstests PATCH] xfstests: add a writeback error handling test

2017-05-09 Thread Jeff Layton
On Mon, 2017-04-24 at 08:00 -0700, Christoph Hellwig wrote: > On Mon, Apr 24, 2017 at 09:45:51AM -0400, Jeff Layton wrote: > > With the patch series above, ext4 now passes. xfs and btrfs end up in > > r/o mode after the test. xfs returns -EIO at that point though, and > > btrfs returns -EROFS. What

Re: [f2fs-dev] [PATCH] f2fs: make sure f2fs_gc returns consistent errno

2017-05-09 Thread Chao Yu
On 2017/5/9 19:37, Weichao Guo wrote: > By default, f2fs_gc returns -EINVAL in general error cases, e.g., no victim > was selected. However, the default errno may be overwritten in two cases: > gc_more and BG_GC -> FG_GC. We should return consistent errno in such cases. How about clean up this pat