When mounting with test_dummy_encryption option, if encrypt feature
is not set, return fail instead of setting encrypt feature forcely.
Cc: linux-e...@vger.kernel.org
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/ext4/super.c | 7 +++
1 file changed, 3 insertions(+), 4 del
This patch introduces a new mount option `test_dummy_encryption'
to allow fscrypt to create a fake fscrypt context. This is used
by xfstests.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
Documentation/filesystems/f2fs.txt | 2 ++
fs/f2fs/dir.c | 4 +++-
f
* add sysfs entry for LOST_FOUND feature
---8<---
This patchset introduces LOST_FOUND feature in f2fs. If the feature is
enabled, f2fs should avoid to encrypt root directory.
A new mount option "test_dummy_encryption" is introduced, this is used by
xfstests.
Thanks,
Sheng
Sheng Yo
.
lost+found directory could not be encrypted. As a result, the root
directory cannot be encrypted too. So if LOST_FOUND feature is enabled,
let's avoid to encrypt root directory.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
Reviewed-by: Chao Yu <yuch...@huawei.com>
---
fs/f2fs/f2fs.h
Hi, Chao
On 2018/3/9 20:32, Chao Yu wrote:
On 2018/3/9 15:53, Sheng Yong wrote:
This patch introduces a new mount option `test_dummy_encryption' to
allow fscrypt to create a fake fscrypt context. This is used by xfstests.
It needs to add doc for this new mount option.
Oh. Right, I'll
is is used by
xfstests.
Thanks,
Sheng
Sheng Yong (3):
f2fs: introduce F2FS_FEATURE_LOST_FOUND feature
f2fs: introduce a new mount option test_dummy_encryption
ext4: do not allow mount with test_dummy_encryption if encrypt not set
fs/ext4/super.c | 5 +++--
fs/f2fs/dir.c | 4 +++-
When mounting with test_dummy_encryption option, if encrypt feature
is not set, return fail instead of setting encrypt feature forcely.
CC: linux-e...@vger.kernel.org
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/ext4/super.c | 5 +++--
1 file changed, 3 insertions(+), 2 del
This patch introduces a new mount option `test_dummy_encryption' to
allow fscrypt to create a fake fscrypt context. This is used by xfstests.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/dir.c | 4 +++-
fs/f2fs/f2fs.h | 11 +++
fs/f2fs/namei.c | 9 ++---
f
On 2018/3/7 11:30, heyunlei wrote:
-Original Message-
From: shengyong (A)
Sent: Wednesday, March 07, 2018 11:21 AM
To: heyunlei; jaeg...@kernel.org; Yuchao (T);
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] dump.f2fs: fix a wrong report for dump an {d,
id,
Hi, Yunlei,
On 2018/3/7 10:41, Yunlei He wrote:
fix a wrong report for dump an {d,id,did}node like this:
[print_node_info: 283] Node ID [0x6820:26656] is direct node or indirect node.
[0] [0x 16b6684 : 23815812]
[1] [0x 16b6685 : 23815813]
[2]
Testcases:
1) corrupt nat_entry->blk_addr of dir [PASS]
2) corrupt nat_entry->blk_addr of encrypt-dir [PASS]
3) remove lost+found, then corrupt nat_entry->blk_addr of dir [PASS]
Any comments and tests are appreciated.
Thanks,
Sheng
Sheng Yong (2):
mkfs.f2fs: create lost+found dir
have no parent directory or their parent
directory is removed by fsck. Encrypted files are also allowed to be
saved here.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
Reviewed-by: Chao Yu <yuch...@huawei.com>
---
fsck/mount.c| 3 +
include/f2fs_fs.h |
. This is used by
xfstests.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
v3->v2:
* fix test_dummy_encryption
v2->v1:
* introduce new mount option test_dummy_encryption
* add sysfs entry for LOST_FOUND feature
fs/f2fs/dir.c | 6 --
fs/f2fs/f2fs.h | 17 ++
. If reconnect fails drop the node and restore filesystem metadata.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dir.c | 19 ++-
fsck/fsck.c | 389 ++-
fsck/fsck.h | 3 +
fsck/mount.c | 2 +
4 files change
This is because config.h is not included first, as a result, macros
defined in config.h is not recognized. So let's include f2fs_fs.h
before other header files.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
tools/fibmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -
. This is used by
xfstests.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
v2->v1:
* introduce new mount option test_dummy_context
* add sysfs entry for LOST_FOUND feature
fs/f2fs/f2fs.h | 6 ++
fs/f2fs/super.c | 37 +
fs/f2fs/sysfs.c | 7 +++
In sanity_check_nid, __check_inode_mode will check i_mode value of an
inode. So integrate sanity_check_inode to __check_inode_mode to clean
up the code.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/fsck.c | 33 +++--
1 file changed, 11 insertions(
fsck will cache all valid nat entries in memory. But when we try to
get a nat entry which is not cached, for example allocate a new nid
during reconnecting files, we need to read the uncached nat entry
from nat block again.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/mount
. And
discard obsolete dnodes after all inodes are created.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
include/f2fs_fs.h | 5
mkfs/f2fs_format.c | 85 ++
2 files changed, 46 insertions(+), 44 deletions(-)
diff --git a/include/f2fs_
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
Reviewed-by: Chao Yu <yuch...@huawei.com>
---
lib/libf2fs.c | 18 ++
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index e8b1842..0c684d5 100644
--- a/lib/libf2fs.c
+++ b/l
have no parent directory or their parent
directory is removed by fsck. Encrypted files are also allowed to be
saved here.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/mount.c| 3 +
include/f2fs_fs.h | 6 ++
mkfs/f2fs_format.c
. If reconnect fails drop the node and restore filesystem metadata.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dir.c | 19 ++-
fsck/fsck.c | 388 ++-
fsck/fsck.h | 3 +
fsck/mount.c | 2 +
4 files change
rupt nat_entry->blk_addr of dir [PASS]
Any comments and tests are appreciated.
Thanks,
Sheng
Sheng Yong (7):
fsck.f2fs: fix typo
mkfs.f2fs: introduce mkfs parameters in f2fs_configuration
f2fs-tools: init f2fs_configuration as 0
fsck.f2fs: integrate sanity_check_inode to __check_inode_mode
m
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fsck/main.c b/fsck/main.c
index 804f71a..bbf82c3 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -137,7 +137,7 @@ static void error_out(char *prog)
Hi, Jaegeuk
On 2018/2/10 10:50, Jaegeuk Kim wrote:
On 02/06, Sheng Yong wrote:
This patchset introduces lost+found feature in f2fs. If the feature is
enabled, f2fs should avoid to encrypting root directory.
In that case, we need to add test_dummy_encryption likewise ext4
Hi, Chao
On 2018/2/8 21:29, Chao Yu wrote:
On 2018/2/6 12:31, Sheng Yong wrote:
Introduce lost+found feature. The lost+found is a directory which saves
Nitpick, lost_found feature...
Needs to add /sys/fs/f2fs/features/lost_found sysfs entry, and show
'lost_found' in /sys/fs/f2fs//features
Hi, Chao
On 2018/2/8 23:08, Chao Yu wrote:
On 2018/2/6 12:31, Sheng Yong wrote:
This patch introduces a new feature F2FS_FEATURE_LOST_FOUND. It can be
switched on by indicating a new option `lost+found' with -O. If
Not sure, do we need to change this option to 'lost_found' to follow other
Hi, Chao
Add Hyojun.
On 2018/2/8 21:30, Chao Yu wrote:
On 2018/2/6 12:31, Sheng Yong wrote:
/* only root inode was written before truncating dnodes */
last_inode_pos = start_inode_pos +
- c.cur_seg[CURSEG_HOT_NODE] * c.blks_per_seg + quota_inum
On 2018/2/7 18:01, Sheng Yong wrote:
[...]
+
+/* lookup lost+found in root directory */
+lpf_ino = f2fs_lookup(sbi, node, (u8 *) LPF, strlen(LPF));
The 4th parameter should be namelen but not strlen(LPF).
Sorry for the noise. The comment here is wrong :(
[...]
+
+static int
On 2018/2/6 12:31, Sheng Yong wrote:
This patch introduces lost+found feature to fsck. If a file is found
unreachable by fsck. Fsck tries to reconnect the file to lost+found
directory:
1. Scan all unreachable file inodes, ignore non-inodes ones and
directories.
2. Check them and fix
This patchset introduces lost+found feature in f2fs. If the feature is
enabled, f2fs should avoid to encrypting root directory.
For more information, please check the mail "f2fs-tools: introduce lost+
found feature".
Thanks,
Sheng
Sheng Yong (2):
f2fs: clean up f2fs_sb_has_xxx
This patch introduces F2FS_FEATURE_FUNCS to clean up the definitions of
different f2fs_sb_has_xxx functions.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/data.c| 2 +-
fs/f2fs/f2fs.h| 51 +--
fs/f2fs/file.c
to
save unreachable files, which have no parent directory or their parent
directory is removed by fsck. Encrypted files are also allowed to be
saved here.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/mount.c| 3 +
include/f2fs_fs.h | 6 ++
mkfs/f2fs_fo
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
lib/libf2fs.c | 18 ++
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index e8b1842..0c684d5 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -586,24 +586,17 @
. If reconnect fails drop the node and restore filesystem metadata.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dir.c | 19 ++-
fsck/fsck.c | 376 ++-
fsck/fsck.h | 3 +
fsck/mount.c | 2 +
4 files change
, the root directory cannot be encrypted. So if lost+found
feature is enabled, let's avoid to encrypt root directory.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/f2fs.h | 2 ++
fs/f2fs/super.c | 12
2 files changed, 14 insertions(+)
diff --git a/fs/f2fs/f2fs.
[Fail]
[FIX] (nullify_nat_entry:2064) --> Remove nid [0xb] in NAT
[FIX] (nullify_nat_entry:2064) --> Remove nid [0xf] in NAT
Info: Write valid nat_bits in checkpoint
Done.
$ tree /data
/data/
└── lost+found
├── 12
├── 14
├── 16
└── 6
Any comments and tests are app
.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
include/f2fs_fs.h | 5 +
mkfs/f2fs_format.c | 46 +-
2 files changed, 22 insertions(+), 29 deletions(-)
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 548a3e8..ca4522d
In sanity_check_nid, __check_inode_mode will check i_mode value of an
inode. So integrate sanity_check_inode to __check_inode_mode to clean
up the code.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/fsck.c | 26 +-
1 file changed, 5 insertions(
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
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
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 <shengyo...@huawei.com>
---
fs/f2fs/super.c | 4 ++--
1 file chan
0
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
v2->v1: do not change the index in meta inode
make move_data_block aware EAGAIN error
---
fs/f2fs/gc.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 33e79697e41c..aa720c
k+0x3a7/0x6f0
[ 246.756533] worker_thread+0x82/0x750
[ 246.756537] kthread+0x16f/0x1c0
[ 246.756541] ? trace_event_raw_event_workqueue_work+0x110/0x110
[ 246.756544] ? kthread_create_worker_on_cpu+0xb0/0xb0
[ 246.756548] ret_from_fork+0x1f/0x30
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
an option for user to decide if the readahead is
needed.
thanks,
Sheng
On Thu, Nov 23, 2017 at 10:11 PM, Chao Yu <c...@kernel.org> wrote:
On 2017/11/22 18:23, Sheng Yong wrote:
This patch introduces a sysfs interface readdir_ra to enable/disable
readaheading inode block in f2fs_readdir.
On 2017/12/15 14:26, Yunlong Song wrote:
Signed-off-by: Yunlong Song
---
fsck/fsck.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 11b8b0b..2212aa3 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -14,6
On 2017/12/15 14:25, Yunlong Song wrote:
Signed-off-by: Yunlong Song
---
fsck/fsck.c | 19 ---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 2212aa3..8ff4e4b 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
Commit d260081ccf37 ("f2fs: change recovery policy of xattr node block")
removes the use of blkaddr, which is no longer used. So remove the
parameter.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/f2fs.h | 3 +--
fs/f2fs/node.c | 2 +-
fs/f2fs/recovery
If there is not enough space left, f2fs_preallocate_blocks may only
preallocte partial blocks. As a result, the write operation fails
but i_blocks is not 0. To avoid this, f2fs should write data in
non-preallocation way and write as many data as the size of i_blocks.
Signed-off-by: Sheng Yong
0m01.94s user 0m50.80s system
enable readdir_ra: 0m18.55s real 0m00.44s user 0m15.39s system
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
Documentation/ABI/testing/sysfs-fs-f2fs | 6 ++
fs/f2fs/dir.c | 4
fs/f2fs/f2fs.h
This patch exports read_all_xattrs to allow dump/fsck to get all xattrs,
and introduces print_xattr_entry which tries to parse an xattr entry
accroding to its xattr index.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
v3->v5:
Please ignore the previous [PATCH v3/v4] because o
This patch exports read_all_xattrs to allow dump/fsck to get all xattrs,
and introduces print_xattr_entry which tries to parse an xattr entry
accroding to its xattr index.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
v3->v4:
Please ignore the previous [PATCH v3] because o
This patch exports read_all_xattrs to allow dump/fsck to get all xattrs,
and introduces print_xattr_entry which tries to parse an xattr entry
accroding to its xattr index.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
v2->v3:
check if is supported. If it is not, print ACL val
This patch removes an extra '\n' at the end of the string in FIX_MSG.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/fsck.c | 4 ++--
fsck/mount.c | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 77490d8..1905319
With --dry-run enabled, fsck.f2fs will do all checks and "fixes" except
that all fixes will not be written to storage at last.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
Reviewed-by: Chao Yu <yuch...@huawei.com>
---
fsck/main.c | 14 +-
include
Do not set fix_on if it is allowed by user.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/main.c | 2 +-
fsck/mount.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/fsck/main.c b/fsck/main.c
index c9411eb..93037e1 100644
--- a/fsck/main.c
+++ b/fsck/
This patch exports read_all_xattrs to allow dump/fsck to get all xattrs,
and introduces print_xattr_entry which tries to parse an xattr entry
accroding to its xattr index.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dump.c | 18 -
fsck/fsck.h | 7 +++-
fsck/m
Fixing corrupted data depends on c.fix_on. If it's not set, we should not
force fixing corrupted data. So if nat entries are found invalid when
building nat_area_bitmap, we should just set c.bug_on, and fix it later.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
Reviewed-by: Chao Yu
If a file is encrypted, its content is cipher text on the storage. So
there is no need to dump an encrypted file.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
Reviewed-by: Chao Yu <yuch...@huawei.com>
---
fsck/dump.c | 12
1 file changed, 8 insertions(+), 4 deleti
v1-v2:
[PATCH 3] print values of USER/SECRUITY xattr as hex instead of plain text.
[PATCH 4] replace xattr value if it already exists by setting parameter
`flags' as 0 of fsetxattr.
[PATCH 1/7] move message printing modification into a different patch.
thanks,
Sheng
Sheng Yong (9
Commit 7d96d138a378 ("fsck.f2fs: remove list.h") has already the usage
of list.h. So let's remove list.h itself.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
Reviewed-by: Chao Yu <yuch...@huawei.com>
---
include/list.h | 88
This patch introduces dump_xattr to create xattrs for dumped files.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dump.c | 63 ++---
1 file changed, 60 insertions(+), 3 deletions(-)
diff --git a/fsck/dump.c b/fsck/dump.c
f2fs_iget checks if i_mode is valid. If it is not, the file cannot be
accessed as well as deleted. To make sure such files can be removed,
fsck adds the same check, and removes incorrect inode blocks.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/fsck.c | 21 ++
On 2017/10/31 15:06, Chao Yu wrote:
On 2017/10/31 9:38, Sheng Yong wrote:
Do not set fix_on if it is allowed by user.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/main.c | 2 +-
fsck/mount.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fsck/
On 2017/10/31 16:04, Chao Yu wrote:
On 2017/10/31 9:38, Sheng Yong wrote:
f2fs_iget checks if i_mode is valid. If it is not, the file cannot be
accessed as well as deleted. To make sure such files can be removed,
fsck adds the same check, and removes incorrect inode blocks.
Signed-off
On 2017/10/31 15:57, Chao Yu wrote:
On 2017/10/31 9:38, Sheng Yong wrote:
With --dry-run enabled, fsck.f2fs will do all checks and "fixes" except
that all fixes will not be written to storage at last.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/m
On 2017/10/31 15:57, Chao Yu wrote:
On 2017/10/31 9:38, Sheng Yong wrote:
If a file is encrypted, its content is cipher text on the storage. So
there is no need to dump an encrypted file.
IMO, if user have encryption key, it still has chance to read that file,
right? So how about keeping
On 2017/10/31 15:51, Chao Yu wrote:
On 2017/10/31 9:38, Sheng Yong wrote:
This patch introduces dump_xattr to create xattrs for dumped files.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dump.c | 63 ++---
On 2017/10/31 15:51, Chao Yu wrote:
On 2017/10/31 9:38, Sheng Yong wrote:
[...]
+
+void print_xattr_entry(struct f2fs_xattr_entry *ent)
+{
+ char *value = (char *)(ent->e_name + le16_to_cpu(ent->e_name_len));
+ struct fscrypt_context *ctx;
+ int i;
+
+ MSG(0, &q
Hi, Chao
On 2017/10/31 15:20, Chao Yu wrote:
On 2017/10/31 9:38, Sheng Yong wrote:
Fixing corrupted data depends on c.fix_on. If it's not set, we should not
force fixing corrupted data. So if nat entries are found invalid when
building nat_area_bitmap, we should just set c.bug_on, and fix
This patch introduces dump_xattr to create xattrs for dumped files.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dump.c | 63 ++---
1 file changed, 60 insertions(+), 3 deletions(-)
diff --git a/fsck/dump.c b/fsck/dump.c
Fixing corrupted data depends on c.fix_on. If it's not set, we should not
force fixing corrupted data. So if nat entries are found invalid when
building nat_area_bitmap, we should just set c.bug_on, and fix it later.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/mount.
If a file is encrypted, its content is cipher text on the storage. So
there is no need to dump an encrypted file.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dump.c | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/fsck/dump.c b/fsck/dump.c
Do not set fix_on if it is allowed by user.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/main.c | 2 +-
fsck/mount.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fsck/main.c b/fsck/main.c
index c9411eb..93037e1 100644
--- a/fsck/main.c
+++ b/fsck/
This patch exports read_all_xattrs to allow dump/fsck to get all xattrs,
and introduces print_xattr_entry which tries to parse an xattr entry
accroding to its xattr index.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dump.c | 18 -
fsck/fsck.h | 7 +++-
fsck/m
f2fs_iget checks if i_mode is valid. If it is not, the file cannot be
accessed as well as deleted. To make sure such files can be removed,
fsck adds the same check, and removes incorrect inode blocks.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/fsck.c
Commit 7d96d138a378 ("fsck.f2fs: remove list.h") has already the usage
of list.h. So let's remove list.h itself.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
include/list.h | 88 --
1 file changed, 88 deletions
With --dry-run enabled, fsck.f2fs will do all checks and "fixes" except
that all fixes will not be written to storage at last.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/main.c | 14 +-
include/f2fs_fs.h | 1 +
lib/libf2fs.c | 1 +
lib/li
Hi, Jaegeuk
On 2017/7/1 23:10, Jaegeuk Kim wrote:
Hi,
On 06/26, Sheng Yong wrote:
After renaming a directory, fsck could detect unmatched pino. The scenario
can be reproduced as the following:
$ mkdir /bar/subbar /foo
$ rename /bar/subbar /foo
Then fsck will report:
[ASSERT
Since directories will be written back with checkpoint and fsync a
directory will always write CP, there is no need to set LOST_PINO
after creating a directory.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/dir.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff
ino is [0x4]
Rename sets LOST_PINO for old_inode. However, the flag cannot be cleared,
since dir is written back with CP. So, let's get rid of LOST_PINO for a
renamed dir and fix the pino directly at the end of rename.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/namei.c | 5
be reproduced as the following:
$ mkdir /bar/subbar /foo
$ rename /bar/subbar /foo
Then fsck will report:
[ASSERT] (__chk_dots_dentries:1182) --> Bad inode number[0x3] for '..', parent
parent ino is [0x4]
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/di
This patch checks the parameter range passed by ioctl to void that range
exceeds the max_file_blocks limit.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/file.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index e0b2378..eb675f1
Hi, Kinglong
On 1/24/2017 10:42 AM, Kinglong Mee wrote:
> wanted_total_sectors is introduced instead total_sectors,
> so that, the initialize is a fault, drop it.
>
> Signed-off-by: Kinglong Mee
> ---
> mkfs/f2fs_format_main.c | 3 ---
> 1 file changed, 3 deletions(-)
>
Hi Jaegeuk,
On 1/20/2017 5:47 PM, Jaegeuk Kim wrote:
> On 01/20, Sheng Yong wrote:
[..]
>>>
>>> if (!strcmp("fsck.f2fs", prog)) {
>>> - const char *option_string = "ad:fp:t";
>>> + const char *option_string = &
Hi Jaegeuk,
On 1/20/2017 7:19 AM, Jaegeuk Kim wrote:
> Hi Sheng Yong,
>
> I tested this, but failed on -p with arguments.
Sorry, this may because double colon in optsting can only be used
at some Unix-like distributions :(
>
> Could you take a look at this change?
I te
It is reported that fsck.f2fs behaves abnormally when running on MIPS32
rel 2 big endian cpu, since incorrect endianness. So let's correct all
endianess issues of f2fs-tools.
Reported-by: <k...@vodka.home.kg>
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/dir.c
This patch allows fsck run -p without argument. So we could use -p as
-p, -p0, and -p1. '-p' and '-p0' have the same meaning as '-a'.
'-p1' checks more meta data than '-a'.
Reported-by: KARBOWSKI Piotr <piotr.karbow...@gmail.com>
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
> [FSCK] valid_inode_count matched with CP [Ok..] [0x1]
> [FSCK] free segment_count matched with CP [Ok..] [0x24]
> [FSCK] next block offset is free [Ok..]
> [FSCK] fixing SIT types
> [FSCK] other corrupted bugs [Ok..]
>
Reported-by: <k...@vodka.home.kg>
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
Hi, k
Could you please try this? I think I've correct all endianness issue.
And can I have your reported-by and test-by?
thanks,
Sheng
---
fsck/dir.c| 6 +++---
fsck/dump.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/f2fs.h | 2 --
fsck/xattr.h | 1 -
2 files changed, 3 deletions(-)
diff --git a/fsck/f2fs.h b/fsck/f2fs.h
index fbb878a..1a0723c 100644
--- a/fsck/f2fs.h
+++ b/fsck/f2fs.h
@@ -19,8 +19,6 @@
#include
#include
#include
-#i
Hi,
On 11/25/2016 6:30 AM, k...@vodka.home.kg wrote:
> Hi !
>
> I'm using f2fs on router Dlink dir-825 with openwrt/LEDE firmware.
> Its mips32 rel 2 big endian cpu.
>
> mkfs.f2fs - works
> mount - works
> fsck.f2fs - corrupts filesystem
>
> # i'm trying to fsck valid empty mountable f2fs
Hi, Jaegeuk,
On 10/24/2016 10:16 AM, Sheng Yong wrote:
> If fscrypt is enabled, we need to convert the encrypted file name before
> printing it. So let's export convert_encrypted_name for other functions,
> and make it returns the length of converted string.
> This patch
If fscrypt is enabled, we need to convert the encrypted file name before
printing it. So let's export convert_encrypted_name for other functions,
and make it returns the length of converted string.
This patch also changes the parameter of file_is_encrypt to f2fs_inode.
Signed-off-by: Sheng Yong
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/gc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index c9b8a67..93985c6 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -275,7 +275,7 @@ static int get_victim_by_default(
`flags' is used to save value from userspace, there is no need to
initialize it, and FS_FL_USER_VISIBLE is the mask for getflags.
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fs/f2fs/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/f2fs/file.c b/f
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/fsck.c | 2 +-
fsck/mount.c | 8
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index c24eb58..8a6373b 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -383,7 +383,7 @@ stat
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/fsck.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index f349bd8..33e8cf7 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -369,7 +369,7 @@ static int sanity_check_nid(struct f2fs_s
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/mount.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fsck/mount.c b/fsck/mount.c
index e0223e0..3e3d176 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -70,6 +70,7 @@ void print_inode_info(struct f2fs_inode *inode, in
Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
fsck/fsck.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 8a6373b..f349bd8 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -736,7 +736,7 @@ void fsck_chk_inode_blk(struct f2fs_s
101 - 200 of 231 matches
Mail list logo