[f2fs-dev] [PATCH] f2fs: fix potential corruption in area before F2FS_SUPER_OFFSET

2018-01-29 Thread Sheng Yong
sb_getblk does not guarantee the buffer head is uptodate. If bh is not uptodate, the data (may be used as boot code) in area before F2FS_SUPER_OFFSET may get corrupted when super block is committed. Signed-off-by: Sheng Yong --- fs/f2fs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

Re: [f2fs-dev] [PATCH] f2fs: fix heap mode to reset it back

2018-01-29 Thread Chao Yu
Hi Yunlong, On 2018/1/29 11:37, Yunlong Song wrote: > Commit 7a20b8a61eff81bdb7097a578752a74860e9d142 ("f2fs: allocate node > and hot data in the beginning of partition") introduces another mount > option, heap, to reset it back. But it does not do anything for heap > mode, so fix it. I think Jae

Re: [f2fs-dev] [PATCH] f2fs: fix potential corruption in area before F2FS_SUPER_OFFSET

2018-01-29 Thread Chao Yu
On 2018/1/29 16:04, Sheng Yong wrote: > sb_getblk does not guarantee the buffer head is uptodate. If bh is not > uptodate, the data (may be used as boot code) in area before Why boot code can be stored into the position f2fs superblock locates? And even we have updated the buffer, we will still c

[f2fs-dev] [PATCH] f2fs: add sanity check for quota sysfile ino

2018-01-29 Thread Chao Yu
Add missing sanity check for quota sysfile ino. Signed-off-by: Chao Yu --- fs/f2fs/super.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 368f63d7bad2..6011071688ca 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2116,6 +21

Re: [f2fs-dev] [PATCH] f2fs: fix heap mode to reset it back

2018-01-29 Thread Yunlong Song
The old commit allocates hot data & nodes in the beginning of partition both for heap and noheap mode. But from the commit message, the heap mode should be like before, i.e., allocate hot data & nodes from curseg to left. On 2018/1/29 16:12, Chao Yu wrote: Hi Yunlong, On 2018/1/29 11:37, Yunl

Re: [f2fs-dev] [PATCH] f2fs: fix potential corruption in area before F2FS_SUPER_OFFSET

2018-01-29 Thread Sheng Yong
Hi, Chao On 2018/1/29 16:27, Chao Yu wrote: On 2018/1/29 16:04, Sheng Yong wrote: sb_getblk does not guarantee the buffer head is uptodate. If bh is not uptodate, the data (may be used as boot code) in area before Why boot code can be stored into the position f2fs superblock locates? Accordi

Re: [f2fs-dev] [PATCH] f2fs: fix potential corruption in area before F2FS_SUPER_OFFSET

2018-01-29 Thread Chao Yu
Hi Sheng Yong, On 2018/1/29 16:39, Sheng Yong wrote: > Hi, Chao > > On 2018/1/29 16:27, Chao Yu wrote: >> On 2018/1/29 16:04, Sheng Yong wrote: >>> sb_getblk does not guarantee the buffer head is uptodate. If bh is not >>> uptodate, the data (may be used as boot code) in area before >> >> Why boo

Re: [f2fs-dev] [PATCH] f2fs: fix heap mode to reset it back

2018-01-29 Thread Chao Yu
On 2018/1/29 16:31, Yunlong Song wrote: > The old commit allocates hot data & nodes in the beginning of partition > both for heap and > noheap mode. But from the commit message, the heap mode should be like > before, i.e., > allocate hot data & nodes from curseg to left. Let's ping Jaegeuk to ch

Re: [f2fs-dev] [PATCH] f2fs: fix potential corruption in area before F2FS_SUPER_OFFSET

2018-01-29 Thread Sheng Yong
On 2018/1/29 16:58, Chao Yu wrote: Hi Sheng Yong, On 2018/1/29 16:39, Sheng Yong wrote: Hi, Chao On 2018/1/29 16:27, Chao Yu wrote: On 2018/1/29 16:04, Sheng Yong wrote: sb_getblk does not guarantee the buffer head is uptodate. If bh is not uptodate, the data (may be used as boot code) in

[f2fs-dev] [PATCH v3] fsck.f2fs: reduce mem alloc during read sit block

2018-01-29 Thread Yunlei He
This patch reduce mem alloc during read sit block Signed-off-by: Yunlei He Reviewed-by: Chao Yu --- fsck/fsck.c | 10 +++--- fsck/fsck.h | 4 ++-- fsck/mount.c | 47 --- 3 files changed, 37 insertions(+), 24 deletions(-) diff --git a/fsck/fsck

[f2fs-dev] [PATCH v3] fsck.f2fs: read ahead xattr & direct node blocks

2018-01-29 Thread Yunlei He
This patch read ahead xattr & direct node blocks, and keep the order: 1. check data blocks 2. readahead xattr block 3. fsck xattr block 4. readahead {d,id,did}node block 5. fsck {d,id,did}node block With above order, we can avoid unneeded readahead before sub-directory iterated traversing or enco

Re: [f2fs-dev] [PATCH v3] fsck.f2fs: read ahead xattr & direct node blocks

2018-01-29 Thread Chao Yu
On 2018/1/29 17:37, Yunlei He wrote: > This patch read ahead xattr & direct node blocks, and > keep the order: > > 1. check data blocks > 2. readahead xattr block > 3. fsck xattr block > 4. readahead {d,id,did}node block > 5. fsck {d,id,did}node block > > With above order, we can avoid unneeded r

[f2fs-dev] [PATCH v2] f2fs: fix potential corruption in area before F2FS_SUPER_OFFSET

2018-01-29 Thread Sheng Yong
sb_getblk does not guarantee the buffer head is uptodate. If bh is not uptodate, the data (may be used as boot code) in area before F2FS_SUPER_OFFSET may get corrupted when super block is committed. Signed-off-by: Sheng Yong --- fs/f2fs/super.c | 5 ++--- 1 file changed, 2 insertions(+), 3 delet

[f2fs-dev] [PATCH] dump.f2fs: support to dump dirent from blkaddr

2018-01-29 Thread Chao Yu
This patch adds to support to dump dirent info based on block address from dentry data block or inline dentry node. [dump_dentry_block: 627] Inline Dentry block: [dump_dentry_block: 650] bitmap pos[0x0] name[.] len[0x1] hash[0x0] ino[0x4] type[0x2] [dump_dentry_block: 650] bitmap pos[0x1] name[..

Re: [f2fs-dev] [PATCH v2] f2fs: fix potential corruption in area before F2FS_SUPER_OFFSET

2018-01-29 Thread Chao Yu
On 2018/1/29 19:13, Sheng Yong wrote: > sb_getblk does not guarantee the buffer head is uptodate. If bh is not > uptodate, the data (may be used as boot code) in area before > F2FS_SUPER_OFFSET may get corrupted when super block is committed. > > Signed-off-by: Sheng Yong Reviewed-by: Chao Yu