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

2017-04-25 Thread Jan Kara
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 fails. > > > > > > Signed-off-by: Jeff Layton > > > > Hum, but do we really want to clo

Re: [f2fs-dev] [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 fails. > > > > > > > > Signed-

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

2017-04-25 Thread Jan Kara
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: > > > > On Mon 24-04-17 09:22:49, Jeff Layton wrote: > > > > > This ensures that we see errors

[f2fs-dev] [PATCH 1/2] f2fs: introduce __issue_discard_cmd

2017-04-25 Thread Chao Yu
Just cleanup, no logic change. Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 63 ++- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 68a9f8d4d628..57989c2c3a6a 100644 --- a/fs/f2fs/se

[f2fs-dev] [PATCH 2/2] f2fs: introduce __wait_discard_cmd

2017-04-25 Thread Chao Yu
Just cleanup, no logic change. Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 57989c2c3a6a..c88e7535aede 100644 --- a/fs/f2fs/segment.c +++ b/f

[f2fs-dev] [PATCH 1/4] f2fs: reconstruct code to write a data page

2017-04-25 Thread Hou Pengyang
This patch introduces encrypt_one_page which encrypts one data page before submit_bio, and change the use of need_inplace_update. Signed-off-by: Hou Pengyang Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c| 77 +-- fs

[f2fs-dev] [PATCH 2/4] f2fs: lookup extent cache first under IPU scenario

2017-04-25 Thread Hou Pengyang
If a page is cold, NOT atomit written and need_ipu now, there is a high probability that IPU should be adapted. For IPU, we try to check extent tree to get the block index first, instead of reading the dnode page, where may lead to an useless dnode IO, since no need to update the dnode index for IP

[f2fs-dev] [PATCH 4/4] f2fs: unlock dnode before IPU

2017-04-25 Thread Hou Pengyang
Signed-off-by: Hou Pengyang --- fs/f2fs/data.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 9bf9c7d..1d7157b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1381,9 +1381,11 @@ int do_write_data_page(struct f2fs_io_info *fio) */

[f2fs-dev] [PATCH 3/4] f2fs: check IPU before cp to avoid IPU being blocked by cp

2017-04-25 Thread Hou Pengyang
IPU checking is under f2fs_lock_op, as a result, some IPU page(such as fsync/fdatasync IPU) may be blocked by a long time cp. This patch fix this by doing IPU checking before f2fs_lock_op, so fsync IPU could go along with cp. Suggested-by: He Yunlei Signed-off-by: Hou Pengyang --- fs/f2fs/da

[f2fs-dev] [PATCH 0/4] optimize f2fs IPU v3

2017-04-25 Thread Hou Pengyang
patch 1): Reconstruct code in do_write_data_page, code logic stays unchanged, patch 2): f2fs: lookup extent cache first under IPU scenario patch 3): Check IPU before cp to avoid IPU being blocked by cp patch 3): Unlock dnode before IPU Change log for v3: - check IPU without f2fs_lock_op, to a

Re: [f2fs-dev] [PATCH 5/6] f2fs: switch to using fscrypt_match_name()

2017-04-25 Thread Richard Weinberger
Eric, Jaegeuk, On Mon, Apr 24, 2017 at 7:00 PM, Eric Biggers wrote: > From: Eric Biggers > > Switch f2fs directory searches to use the fscrypt_match_name() helper > function. There should be no functional change. > -#ifdef CONFIG_F2FS_FS_ENCRYPTION > - if (unlikely(!name->name))

Re: [f2fs-dev] [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: > > > > > On Mon 24-04-17 09:22:49,

Re: [f2fs-dev] [PATCH 5/6] f2fs: switch to using fscrypt_match_name()

2017-04-25 Thread Eric Biggers
Hi Richard, On Tue, Apr 25, 2017 at 03:37:56PM +0200, Richard Weinberger wrote: > Eric, Jaegeuk, > > > On Mon, Apr 24, 2017 at 7:00 PM, Eric Biggers wrote: > > From: Eric Biggers > > > > Switch f2fs directory searches to use the fscrypt_match_name() helper > > function. There should be no fun

Re: [f2fs-dev] [PATCH 5/6] f2fs: switch to using fscrypt_match_name()

2017-04-25 Thread Richard Weinberger
Eric, Am 25.04.2017 um 19:46 schrieb Eric Biggers: >> Sorry if this is a stupid question, but why do you have to compare hashes >> _and_ >> the last few bytes of the bigname? >> A lookup via bigname gives you two 32bits hash values, and there I'd assume >> that >> this is sufficient for a collis

Re: [f2fs-dev] [PATCH 5/6] f2fs: switch to using fscrypt_match_name()

2017-04-25 Thread Eric Biggers
On Tue, Apr 25, 2017 at 09:22:16PM +0200, Richard Weinberger wrote: > Eric, > > Am 25.04.2017 um 19:46 schrieb Eric Biggers: > >> Sorry if this is a stupid question, but why do you have to compare hashes > >> _and_ > >> the last few bytes of the bigname? > >> A lookup via bigname gives you two 32

Re: [f2fs-dev] [PATCH 5/6] f2fs: switch to using fscrypt_match_name()

2017-04-25 Thread Richard Weinberger
Eric, Am 25.04.2017 um 22:58 schrieb Eric Biggers: > On Tue, Apr 25, 2017 at 09:22:16PM +0200, Richard Weinberger wrote: >> Eric, >> >> Am 25.04.2017 um 19:46 schrieb Eric Biggers: Sorry if this is a stupid question, but why do you have to compare hashes _and_ the last few bytes of

Re: [f2fs-dev] [PATCH 4/4] f2fs: unlock dnode before IPU

2017-04-25 Thread Jaegeuk Kim
On 04/25, Hou Pengyang wrote: > Signed-off-by: Hou Pengyang > --- > fs/f2fs/data.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 9bf9c7d..1d7157b 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -1381,9 +1381,11 @@ int do_write_data_p

Re: [f2fs-dev] [PATCH 2/4] f2fs: lookup extent cache first under IPU scenario

2017-04-25 Thread Jaegeuk Kim
Hi Pengyang, On 04/25, Hou Pengyang wrote: > If a page is cold, NOT atomit written and need_ipu now, there is > a high probability that IPU should be adapted. For IPU, we try to > check extent tree to get the block index first, instead of reading > the dnode page, where may lead to an useless dnod

[f2fs-dev] [PATCH] f2fs: introduce valid_ipu_blkaddr to clean up

2017-04-25 Thread Jaegeuk Kim
This patch introduces valid_ipu_blkaddr to clean up checking block address for inplace-update. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index b2992dbdd11e..c2b98e44c5f3 100

[f2fs-dev] [PATCH 1/1] f2fs-tools: sanity check segment count

2017-04-25 Thread Jin Qian
make sure segment count in super block doesn't exceed F2FS_MAX_SEGMENT. Signed-off-by: Jin Qian --- fsck/mount.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fsck/mount.c b/fsck/mount.c index 761baa0..0111960 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -406,6 +406,9 @@ int sanity_c

[f2fs-dev] [PATCH 1/1] f2fs: sanity check segment count

2017-04-25 Thread Jin Qian
From: Jin Qian F2FS uses 4 bytes to represent block address. As a result, supported size of disk is 16 TB and it equals to 16 * 1024 * 1024 / 2 segments. Signed-off-by: Jin Qian --- fs/f2fs/super.c | 7 +++ include/linux/f2fs_fs.h | 6 ++ 2 files changed, 13 insertions(+) diff

[f2fs-dev] [PATCH] mkfs.f2fs: fix wrong segment assignment

2017-04-25 Thread Jaegeuk Kim
We must guarantee that current segments should be different between different logs. This should resolve xfstests/generic/015 panic. Fixes: 8f9327c0c02ee1 ("mkfs.f2fs: use noheap by default") Signed-off-by: Jaegeuk Kim --- mkfs/f2fs_format.c | 21 + 1 file changed, 21 insertio

Re: [f2fs-dev] [PATCH 3/4] f2fs: check IPU before cp to avoid IPU being blocked by cp

2017-04-25 Thread Jaegeuk Kim
Hi Pengyang, This makes xfstests/generic/013 stuck on fsstress. Thanks, On 04/25, Hou Pengyang wrote: > IPU checking is under f2fs_lock_op, as a result, some IPU page(such as > fsync/fdatasync IPU) > may be blocked by a long time cp. > > This patch fix this by doing IPU checking before f2fs_lo

Re: [f2fs-dev] [PATCH 3/4] f2fs: check IPU before cp to avoid IPU being blocked by cp

2017-04-25 Thread Jaegeuk Kim
On 04/25, Jaegeuk Kim wrote: > Hi Pengyang, > > This makes xfstests/generic/013 stuck on fsstress. Oh, it seems lock inversion problem between f2fs_lock_op and get_dnode_of_data. The basic rule is get_dnode_of_data is covered by f2fs_lock_op. I'll drop this patch at this moment. Thanks, > > Th

Re: [f2fs-dev] [PATCH 3/4] f2fs: check IPU before cp to avoid IPU being blocked by cp

2017-04-25 Thread Chao Yu
Hi Jaegeuk, Pengyang, On 2017/4/26 9:27, Jaegeuk Kim wrote: > On 04/25, Jaegeuk Kim wrote: >> Hi Pengyang, >> >> This makes xfstests/generic/013 stuck on fsstress. > > Oh, it seems lock inversion problem between f2fs_lock_op and > get_dnode_of_data. > The basic rule is get_dnode_of_data is cover

[f2fs-dev] [PATCH] f2fs: release cp and dnode lock before IPU

2017-04-25 Thread Chao Yu
From: Hou Pengyang We don't need to rewrite the page under dnode locks. Signed-off-by: Hou Pengyang Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c| 40 ++-- fs/f2fs/f2fs.h| 2 +- fs/f2fs/gc.c | 1 + fs/f2fs/segment.c | 1 + 4 files changed, 2

[f2fs-dev] [PATCH RESEND] f2fs: release cp and dnode lock before IPU

2017-04-25 Thread Chao Yu
From: Hou Pengyang We don't need to rewrite the page under dnode locks. Signed-off-by: Hou Pengyang Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- Changelog: - remove uneeded f2fs_{un,}lock_op. - add signed-off of mine. fs/f2fs/data.c| 38 --