Jaegeuk Kim [Fri, 4 Jan 2019 21:02:22 +0000 (13:02 -0800)]
fsck.f2fs: don't ask anything on dry-run
It doesn't need to ask recovering corruption on dry-run mode.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Fri, 4 Jan 2019 00:54:04 +0000 (16:54 -0800)]
f2fs_io: add pin_file control command
This requires a kernel patch "f2fs: export pin_file flag to user".
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Mon, 10 Dec 2018 03:19:01 +0000 (11:19 +0800)]
dump.f2fs: fix incorrect endian conversion
f2fs_inode.i_mode is variable of __le16 type, during endian converison,
it should to use le16_to_cpu instead of le32_to_cpu, fix it.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Rosen Penev [Sat, 8 Dec 2018 01:45:31 +0000 (17:45 -0800)]
fsck: Fix big endian platforms
Since "fsck.f2fs: integrate sanity_check_inode to __check_inode_mode",
big endian platforms have been broken due to an endianness bug.
More info: https://github.com/openwrt/openwrt/pull/1575
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Wed, 28 Nov 2018 18:52:05 +0000 (10:52 -0800)]
tools: add f2fs_io
This is initial commit to support shutdown ioctl.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sahitya Tummala [Fri, 28 Dec 2018 07:36:43 +0000 (13:06 +0530)]
parse.f2fs: fix parsing of f2fs_trace_ios
It is incorrectly taking blkaddr as len because it missed to parse
op_flags in the trace print of f2fs_trace_ios.
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Tue, 27 Nov 2018 12:36:35 +0000 (20:36 +0800)]
fsck.f2fs: introduce preen mode 2
As Michael reported:
after updating to f2fs-tools 1.12.0, a routine fsck of my file systems
took quite a while and output ten-thousands instances of the following
line:
> [FIX] (fsck_chk_inode_blk: 954) --> Regular: 0xXYZ reset i_gc_failures from 0x1 to 0x00
The reason is that:
We start to support reseting .i_gc_failures's value to zero in fsck since
91bb7b21f740 ("f2fs-tools: fix to reset i_gc_failures offline"), this is
because if .i_gc_failures continues increasing and exceed threshold, it
can make f2fs break atomic_write semantics during GC, so I added that
patch to avoid such condition.
But the problem here is even .i_gc_failures's value is one which was
initialized duing inode creation by old kernel, and it never be increased
by GC flow, we will still trigger such fix in fsck. I think it's not
necessary.
As Jaegeuk suggested, we introduce a new preen mode 2 to handle such
condition:
- 2: same as 0, but skip some checks for old kernel
Suggested-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reported-by: Michael Laß <bevan@bi-co.net>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Mon, 26 Nov 2018 10:53:37 +0000 (18:53 +0800)]
fsck.f2fs: allow to fsck readonly image w/ -f option
To keep line with e2fsprogs, let's allow to fsck mounted image as
readonly w/ -f option.
Reported-by: Perfect Gentleman <perfect007gentleman@gmail.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Mon, 26 Nov 2018 13:36:00 +0000 (21:36 +0800)]
f2fs-tools: fix to check return value of {c,m}alloc()
It needs to fix to handle error case of {c,m}alloc().
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Thu, 22 Nov 2018 11:57:06 +0000 (03:57 -0800)]
libf2fs: avoid to use static local string for global f2fs_conf
We don't need to use c.rootdev_name, but do it locally.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Thu, 22 Nov 2018 07:18:14 +0000 (23:18 -0800)]
mkfs.f2fs: enable VERITY by default
This enables VERITY by default for android.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Tue, 28 Aug 2018 06:44:54 +0000 (23:44 -0700)]
f2fs-tools: release 1.12.0
This release includes:
- add android default configuration
- fix resgid/resuid
- add more sanity checks
- fix corrupted quota in clean umount
- add superblock checksum
And, there are several bug fixes in fsck.f2fs/sload.f2fs/mkfs.f2fs.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Fri, 16 Nov 2018 05:54:02 +0000 (21:54 -0800)]
f2fs-tools: create sparse file first before stat
We must create a sparse file first before calling stat().
Fixes:
eb9d8037ed3b ("f2fs-tools: avoid mounting f2fs if tools already open the device")
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Fri, 16 Nov 2018 01:38:01 +0000 (17:38 -0800)]
f2fs-tools: show versions if exist
If it's not defined, we need to skip to show the definition.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
taebum81.kim [Mon, 5 Nov 2018 06:43:37 +0000 (15:43 +0900)]
sload.f2fs: fix memory leak
Dynamic memory stored in 'xattr_node' allocated through function 'calloc'
at line 98 can be lost at line 111
Dynamic memory stored in 'inode' allocated through function 'calloc'
at line 144 can be lost at line 227
Signed-off-by: taebum81.kim <taebum81.kim@lge.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Gao Ming [Mon, 15 Oct 2018 13:24:57 +0000 (21:24 +0800)]
f2fs-tools: add the max chunk size limit in sparse image
Malloc Failure occurs in 32bit Windows, when using fastboot.exe flash the
f2fs sparse image filling with up to 2G chunk size.
Signed-off-by: Gao Ming <gaoming20@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sotirios-Efstathios Maneas [Thu, 11 Oct 2018 22:20:53 +0000 (18:20 -0400)]
mkfs.f2fs: Added missing statements related to error checking.
The following patch adds a few missing statements related to error checking.
Signed-off-by: Sotirios-Efstathios Maneas <smaneas@cs.toronto.edu>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Fri, 19 Oct 2018 22:42:40 +0000 (15:42 -0700)]
f2fs-tools: give WITH_KERNEL_VERSION to check kernel version only
This patch adds a build option to relax kernel version and release string to
trigger full scan.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Wed, 17 Oct 2018 01:40:56 +0000 (09:40 +0800)]
mkfs.f2fs: support formating large size file in 32-bits platform
In 32-bits platform, {f,}stat on a large size file during mkfs, it will
cause EOVERFLOW error, this patch fixes to add macro definition
_FILE_OFFSET_BITS to avoid that error.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Randall Huang [Wed, 10 Oct 2018 00:38:01 +0000 (17:38 -0700)]
fsck.f2fs: do not hard-code encrypted filename length to avoid heap buffer overflow
If the len is less than 24, heap buffer overflow is reported.
Signed-off-by: Randall Huang <huangrandall@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Tiezhu Yang [Mon, 8 Oct 2018 12:39:07 +0000 (20:39 +0800)]
mkfs.f2fs: show the info of volume label only when specify it
Currently, when format disk used with mkfs.f2fs, even if the volume label
is not specified, it still shows the info of volume label with no content
due to the check condition is always true, this patch fixes it.
[root@localhost home]# mkfs.f2fs -f /dev/sdb1
F2FS-tools: mkfs.f2fs Ver: 1.12.0 (2018-10-08)
Info: Disable heap-based policy
Info: Debug level = 0
Info: Label =
Info: Trim is enabled
Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Mon, 1 Oct 2018 01:16:38 +0000 (18:16 -0700)]
fsck.f2fs: don't allocate new blocks on unclean shutdown
We have to keep data for roll-forward recovery. Without this patch, we're
able to lose there-in data by quota overwrites.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Wed, 19 Sep 2018 01:28:37 +0000 (09:28 +0800)]
fsck.f2fs: detect and recover corrupted quota file
Once quota file is corrupted, kernel will set CP_QUOTA_NEED_FSCK_FLAG
into checkpoint pack, this patch makes fsck supporting to detect the flag
and try to rebuild corrupted quota file.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Chao Yu [Fri, 28 Sep 2018 12:26:00 +0000 (20:26 +0800)]
fsck.f2fs: try to recover cp_payload from valid cp pack
If sb checksum is not enabled, and cp pack is valid due to no
crc inconsistence, let's try to recover cp_payload based on
cp_pack_start_sum in cp pack.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Fri, 28 Sep 2018 12:25:59 +0000 (20:25 +0800)]
f2fs-tools: introduce sb checksum
This patch introduced crc for superblock.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Fri, 28 Sep 2018 12:25:58 +0000 (20:25 +0800)]
fsck.f2fs: unify the updating of superblocks
Rename write_superblock() to update_superblock() and make it support updating
specified one superblock or both two superblocks, then unify all places where
sb needs to be updated.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Daniel Rosenberg [Wed, 9 May 2018 02:48:33 +0000 (19:48 -0700)]
WIP: Add partial shrinking support to f2fs
allow 'safe' resizing leaving the metadata nearly unchanged.
Will likely need to adjust growing for the case where a fs
had previously shrunk without altering data, and the newly grown
fs would be smaller than the original. Probably makes sense to
case it out into metadata size changes, instead of fs size changes
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Chao Yu [Sun, 30 Sep 2018 08:26:13 +0000 (16:26 +0800)]
dump.f2fs: allow dump data on mounted image
xfstests assumes it's allow to dump data on mounted image, for example,
some common functions call dumpe2fs on mounted ext[2|3|4] image to check
feature lists. To adapt such requirement, let's follow that rule in
dump.f2fs.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Thu, 20 Sep 2018 23:16:07 +0000 (16:16 -0700)]
fsck.f2fs: support checkpoint=disable
This patch shows checkpoint is disabled and keeps the flag for next mount.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Wed, 19 Sep 2018 13:53:48 +0000 (21:53 +0800)]
f2fs-tools: rename CHECKSUM_OFFSET to CP_CHKSUM_OFFSET
This patch renamed CHECKSUM_OFFSET to CP_CHKSUM_OFFSET.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Wed, 29 Aug 2018 21:06:56 +0000 (14:06 -0700)]
doc: add versioning rule
Ted wrote a very useful versioning rule that newbies must read.
Let me remain it in the tree.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Tue, 28 Aug 2018 06:44:54 +0000 (23:44 -0700)]
f2fs-tools: release 1.11.1
This release includes:
- add android default configuration
- fix resgid/resuid
- add more sanity checks
And, there are several bug fixes in fsck.f2fs/sload.f2fs/mkfs.f2fs.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Helmut Grohne [Tue, 28 Aug 2018 00:29:41 +0000 (20:29 -0400)]
f2fs-tools: Fix cross-build problem caused by AC_CHECK_FILE abuse
f2fs-tools fails to cross build from source, because its upstream
build system wrongly uses AC_CHECK_FILE. The purpose of the macro is
checking for files on the host system. However here it is used to
check whether a .git directory exists, which is a property of the
build place. A simple "test -d" should be used here. After doing so,
f2fs-tools cross builds successfully.
Addresses-Debian-Bug: #896909
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Fri, 3 Aug 2018 04:09:05 +0000 (12:09 +0800)]
fsck.f2fs: supply more check entries for checkpoint
Supply some more check entries for checkpoint in sanity_check_ckpt()
and validate_checkpoint() to sync them with kernel.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Sat, 28 Jul 2018 10:40:59 +0000 (18:40 +0800)]
fsck.f2fs: print node block address
Print block address of unreachable node id in fsck_verify() for better
debugging.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Sat, 28 Jul 2018 10:41:35 +0000 (18:41 +0800)]
f2fs-tools: fix to reset i_gc_failures offline
This patch synchronize f2fs_inode structure from kernel side, in
addition, it adds to check .i_gc_failures and do resetting in fsck.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sotirios-Efstathios Maneas [Thu, 26 Jul 2018 22:02:02 +0000 (18:02 -0400)]
mkfs.f2fs: Fixed typos in several printed messages.
Fixed typos in several printed messages.
Signed-off-by: Sotirios-Efstathios Maneas <smaneas@cs.toronto.edu>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Theodore Ts'o [Fri, 24 Aug 2018 07:26:32 +0000 (03:26 -0400)]
build: declare that libf2fs_format uses the blkid library
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Theodore Ts'o [Mon, 20 Aug 2018 03:04:06 +0000 (23:04 -0400)]
add configure option --with-root-libdir
This allows the development link libraries to be installed in
/usr/lib, while the run-libraries are installed in /lib, which is
required by Debian policy. This can be done via:
configure --prefix=/ --libdir=/usr/lib --with-root-libdir=/lib
The technique of working around libtool's inflexibility is borrowed
from util-linux.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Fri, 27 Jul 2018 08:45:57 +0000 (17:45 +0900)]
mkfs.f2fs: add -R 0:0 by default for android
This patch sets "-R 0:0" for android by default.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Fri, 27 Jul 2018 08:12:32 +0000 (17:12 +0900)]
mkfs.f2fs: add root_owner to give uid/gid
This patch adds an option to mkfs.f2fs in order for user to assign uid/gid
to the target partition.
This requires when vold in android formats a sdcard partition.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Rosen Penev [Sat, 14 Jul 2018 18:08:05 +0000 (11:08 -0700)]
mkfs.f2fs: Add several media formats + exe
These media formats are currently in use.
exe is useful if storing various Windows utilities on the drive.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Tue, 10 Jul 2018 14:47:38 +0000 (22:47 +0800)]
f2fs-tools: set namelen parameter of convert_encrypted_name as unsigned
To avoid overflow, set namelen parameter of convert_encrypted_name as
unsigned int. convert_encrypted_name() will check if namelen exceeds the
limitation.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Thu, 12 Jul 2018 03:36:41 +0000 (11:36 +0800)]
fsck.f2fs: init quota_file before re-create quota file
`quota_handle->qh_qf->filesize' is not initialized by quota_create_file().
It contains random value, which is updated to quota file's i_size in
quota_file_close(). Since quota file is re-created, `filesize' can be
initialized as 0.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Tue, 10 Jul 2018 12:29:08 +0000 (20:29 +0800)]
fsck.f2fs: fix to do sanity check with extra_attr feature
This patch tries to fix incorrect extra_attr bit or i_extra_isize value
in fsck.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Wed, 4 Jul 2018 09:50:45 +0000 (17:50 +0800)]
f2fs-tools: avoid mounting f2fs if tools already open the device
If the block device is opened by tools, F2FS should not be mounted.
Especially when fsck is running, errors unexpected may happen. So if
tools open a block device, we give it the O_EXCL flag to make sure
the block device is opened exclusivly.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Tue, 3 Jul 2018 10:10:04 +0000 (18:10 +0800)]
fsck.f2fs: check extent of inline data/dentry inode
Check extent for inline data/dentry inode. If an inode contains inline
data/dentry, it should have no extent.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=200175
Reported-by: Wen Xu <wen.xu@gatech.edu>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Mon, 2 Jul 2018 09:22:41 +0000 (17:22 +0800)]
dump.f2fs: only dump nat inside the specified nid range
Only dump nat info of nids inside the specified range.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Yunlei He [Tue, 26 Jun 2018 08:06:54 +0000 (16:06 +0800)]
fsck.f2fs: fix wrong err message of check quota node
This patch fix wrong err message of check quota node.
Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Wed, 20 Jun 2018 13:06:16 +0000 (21:06 +0800)]
f2fs-tools: fix compile errors on AOSP
Include needed header files directly to fix compile errors on AOSP.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Wed, 13 Jun 2018 10:13:59 +0000 (18:13 +0800)]
f2fs-tools: do not count free_segs in flush_sit_entries
flush_sit_entries() is always called before write_checkpoint(). Since
free_segs is counted in write_checkpoint, there is no need to do that
in flush_sit_entries. Besides, the value of free_segs may be not
correct if we skip uptodate seg_entries.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Wed, 20 Jun 2018 11:12:13 +0000 (19:12 +0800)]
fsck.f2fs: introduce fsck_chk_curseg_info
If curseg is an empty segment, it will not be checked. This patch
introduces fsck_chk_curseg_info() to check SIT/SSA type of cursegs
to avoid curseg corruption.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Wed, 13 Jun 2018 01:51:49 +0000 (09:51 +0800)]
sload.f2fs: update sit entries of cursegs
move_curseg_info->reset_curseg changes cursegs, however, new segment
entries are not set as dirty. As a result, flush_sit_entries will not
update entries in SIT, especially when an empty segment is selected
as the new curseg, its seg_entry->type is lost.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Thu, 21 Jun 2018 01:20:32 +0000 (09:20 +0800)]
fsck.f2fs: show missing large_nat_bitmap flag in print_ckpt_info
Previously, we forget to print large_nat_bitmap according to CP flag,
fix it.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Fri, 8 Jun 2018 05:11:48 +0000 (13:11 +0800)]
fsck.f2fs: do not print content beyond sb->version
Currently, versions in f2fs_configuration have one more byte than
those in sb, so versions in sb may not end with '\0', and then
print_raw_sb_info() will print something beyond sb->version.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Mon, 4 Jun 2018 08:14:36 +0000 (16:14 +0800)]
resize.f2fs: skip cursegs when finding next free block
resize.f2fs (f2fs_defragment) tries to migrate blocks to new positions.
However, if a curseg is selected, and f2fs_defragment is broken by any
error, curseg->next_blkoff is left not updated.
To avoid this, we skip cursegs when finding next free block.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Baruch Siach [Wed, 13 Jun 2018 17:48:34 +0000 (20:48 +0300)]
configure: uclinux is also linux
Linux systems on no-MMU platforms identify as uclinux. They are
otherwise identical to plain Linux.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Yunlong Song [Wed, 30 May 2018 07:03:49 +0000 (15:03 +0800)]
f2fs-tools: fix to ignore sg_write_buffer in git
Add tools/sg_write_buffer/sg_write_buffer to .gitignore.
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Yunlong Song [Wed, 30 May 2018 06:58:29 +0000 (14:58 +0800)]
f2fs-tools: fix overflow bug of start_sector when computing zone_align_start_offset
zone_align_start_offset should be u64, but config.start_sector is u32,
so it may be overflow when computing zone_align_start_offset.
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Yunlong Song [Mon, 7 May 2018 02:15:36 +0000 (10:15 +0800)]
f2fs-tools: fix to match with the start_sector
f2fs-tools uses ioctl BLKSSZGET to get sector_size, however, this ioctl
will return a value which may be larger than 512 (according to the value
of q->limits.logical_block_size), then this will be inconsistent with
the start_sector, since start_sector is got from ioctl HDIO_GETGEO and
is always in 512 size unit for a sector. To fix this problem, just
change the sector_size to the default value when computing with
start_sector. And fix sectors_per_blk as well.
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Adam Borowski [Thu, 24 May 2018 21:17:01 +0000 (23:17 +0200)]
libf2fs: read "disk model" from SCSI ioctl the same way kernel does
Ref: drivers/scsi/scsi_scan.c scsi_add_lun()
Ie, fixed-width 16 bytes, assumed to be filled with spaces -- NOT
null-terminated; comments suggest that in some cases this field can be
truncated and filled with nulls but printf is fine with that.
The old code did read up to 64 characters, which produced garbage for
at least some USB-attached card readers. It also special-cased '`'
character which the kernel does not.
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Thu, 24 May 2018 01:12:14 +0000 (18:12 -0700)]
mkfs.f2fs: not allow to format too small sized partition
For example, if we want to format 40MB image, it'll give 12 segments for main
area. And, it assigns 6 for current segments, 11 for ovp segments, and 10 for
reserved segments. So, we have 5 free segments, which we can't handle:
# of free segments < # of reserved segments.
Reported-by: Daniel Rosenberg <drosen@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Mon, 23 Apr 2018 06:01:45 +0000 (14:01 +0800)]
fsck.f2fs: fix to avoid accessing invalid memory address
This patch adds to check return value of calloc in write_superblock().
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Thu, 19 Apr 2018 20:53:31 +0000 (13:53 -0700)]
fsck.f2fs: add -O features to tune the bits
This patch add -O features for fsck.f2fs in order to tune the feature bits.
Currently, it supports -O encrypt only.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Thu, 19 Apr 2018 20:41:31 +0000 (13:41 -0700)]
mkfs.f2fs: factor out feature table from mkfs.f2fs
This patch makes feature bit work be global in f2fs-tools.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Thu, 19 Apr 2018 18:33:14 +0000 (11:33 -0700)]
f2fs-tools: add -g to give default options
This patch adds -g option to set default options for specific environment.
I added it for android as a example.
# mkfs.f2fs -g android $dev
: gives "-d1 -f -O encrypt -O quota -w 4096"
# fsck.f2fs -g android $dev
: gives "-a"
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Sun, 15 Apr 2018 14:36:33 +0000 (22:36 +0800)]
mkfs.f2fs: use an array to manage features
Use an array to manage features and their masks for mkfs.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Tue, 10 Apr 2018 03:28:20 +0000 (11:28 +0800)]
f2fs-tools: remove duplicated declaration of f2fs_configuration c
The variable `c' is declared twice in f2fs_fs.h. This patch removes
the second declaration.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Tue, 10 Apr 2018 03:28:19 +0000 (11:28 +0800)]
f2fs-tools: introduce new option V to show version
This patch introduces a new option -V to show the version of f2fs tools
and exit after that.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Sun, 8 Apr 2018 02:14:29 +0000 (10:14 +0800)]
resize.f2fs: clear CP_COMPACT_SUM_FLAG when rebuilding checkpoint
Resize rebuilds checkpoint with 6 summary blocks, so if
CP_COMPACT_SUM_FLAG is set in the old checkpoint, clear it.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Sun, 8 Apr 2018 04:09:13 +0000 (12:09 +0800)]
mkfs.f2fs: support multiple features with one "-O"
Now one "-O" option can support multiple features separated
by a comma or blank, such as:
feature1,feature2,... or "feature1 feature2 ..."
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Wed, 4 Apr 2018 02:49:14 +0000 (10:49 +0800)]
mkfs.f2fs: fix incorrect cold data location
If last_zone((total_zones >> 2)) is equal or less than
next_zone(CURSEG_COLD_NODE), cold data area will be located in the
same position with hot data, fixes it.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Tue, 10 Jul 2018 19:38:57 +0000 (12:38 -0700)]
f2fs-tools: release 1.11.0
This release includes:
- add sg_write_buffer for UFS firmware update in Android
- wanted_sector_size to specify sector size explicity
- support fsverity feature bit
- support lost+found feature
And, it includes some critical bug fixes.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Sun, 17 Jun 2018 00:09:23 +0000 (17:09 -0700)]
resize.f2fs: fix wrong nat_bits migration
When wring the last nat_bits in new checkpoint, we call write_nat_bits()
to recover the nat_bits. But, we didn't update nm_i->nat_bitmap which we can
get the up-to-date nat blocks. After sit migration, old checkpoint has no
longer valid nat blocks, resulting in wrong free nid allocation at the following
mount time.
Let's indicate new nat_blocks by adjusting nat_bitmap in nat migration.
Reported-by: Lianjun Huang <huanglianjun@vivo.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Sun, 17 Jun 2018 17:56:49 +0000 (10:56 -0700)]
fsck.f2fs: add sanity check nat_bits
This patch adds to check nat_bits is valid or not. If not, it writes correct
nat_bits.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Mon, 26 Mar 2018 12:47:37 +0000 (20:47 +0800)]
fsck.f2fs: simplify fsck_chk_quota_node in PREEN_MODE_1
Do not do fsck_chk_node_blk to simplify fsck_chk_quota_node in
PREEN_MODE_1, as well as fsck_chk_orphan_node.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Tue, 6 Mar 2018 03:39:40 +0000 (11:39 +0800)]
fsck.f2fs: reconnect unreachable files to lost+found
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 incorrupted data to make sure filesystem
metadata (mainly counters and main/nat bitmap) are all consistent.
3. Reconnect these files to lost+found. If lost+found does not exist,
create it first. During reconnecting, expand lost+found's dentry
block automatically. Reconnected files are renamed after its ino
number.
4. If reconnect fails drop the node and restore filesystem metadata.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Tue, 6 Mar 2018 03:39:39 +0000 (11:39 +0800)]
mkfs.f2fs: create lost+found directory
This patch introduces a new feature F2FS_FEATURE_LOST_FOUND. It can be
switched on by indicating `-O lost_found'. If LOST_FOUND feature is
enabled, an empty directory lost+found is created by mkfs.
This is a preparation for fsck. During fsck, the directory is used 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 <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: use uint64_t to avoid build warning]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Yunlei He [Wed, 7 Mar 2018 03:59:54 +0000 (11:59 +0800)]
dump.f2fs: fix a wrong report for dump an {d,id,did}node
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] [0x 16b6686 :
23815814]
[3] [0x 16b6687 :
23815815]
[4] [0x 16b6688 :
23815816]
[5] [0x 16b6689 :
23815817]
[6] [0x 16b668a :
23815818]
[7] [0x 16b668b :
23815819]
[8] [0x 16b668c :
23815820]
[9] [0x 16b668d :
23815821]
[10] [0x 16b668e :
23815822]
Invalid (i)node block
Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Wed, 28 Feb 2018 09:03:44 +0000 (17:03 +0800)]
mkfs.f2fs: treat db's data as hot one
DB files like .db, .db-journal, .db-wal, .db-shm are very active, this
patch adds db file type to hot file extension list by default.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Thu, 1 Mar 2018 02:48:47 +0000 (10:48 +0800)]
mkfs.f2fs: support hot file extension
This patch adds new option '-E' to accept user configured hot file
extension, in order to let kernel module handle hot/cold file's datas
separately better.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Tue, 27 Feb 2018 08:39:33 +0000 (16:39 +0800)]
fibmap: include f2fs_fs.h before other header files
GCC 7.2.0 is unhappy with the usage of major/minor:
fibmap.c: In function ‘print_stat’:
fibmap.c:70:13: warning: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "major", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"major", you should undefine it after including <sys/types.h>.
printf("dev [%d:%d]\n", major(st->st_dev), minor(st->st_dev));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Fri, 23 Feb 2018 03:18:00 +0000 (11:18 +0800)]
fsck.f2fs: read nat block if nat entry is invalid
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 <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Fri, 23 Feb 2018 03:17:58 +0000 (11:17 +0800)]
fsck.f2fs: integrate sanity_check_inode to __check_inode_mode
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 <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Fri, 23 Feb 2018 03:17:56 +0000 (11:17 +0800)]
mkfs.f2fs: introduce mkfs parameters in f2fs_configuration
Introduce new parameters in f2fs_configuration for mkfs:
* next_free_nid: save the next free nid
* quota_inum: save how many blocks are used for quota inodes
* quota_dnum: save how many blocks are used for quota data
Use these parameters to avoid duplicated count of these values. And
discard obsolete dnodes after all inodes are created.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Fri, 23 Feb 2018 03:17:55 +0000 (11:17 +0800)]
fsck.f2fs: fix typo
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Sheng Yong [Tue, 6 Feb 2018 04:31:22 +0000 (12:31 +0800)]
f2fs-tools: init f2fs_configuration as 0
use memset() to zerofy entire value.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Tue, 6 Feb 2018 08:47:14 +0000 (16:47 +0800)]
dump.f2fs: correct the seg type in ssa_dump
Fix the mixed using of "ret" in ssa_dump.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Thu, 8 Feb 2018 15:17:11 +0000 (23:17 +0800)]
mkfs.f2fs: fix to handle endianness in f2fs_write_check_point_pack
This patch fixes to handle missing endianness in f2fs_write_check_point_pack.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Thu, 8 Feb 2018 01:36:46 +0000 (17:36 -0800)]
fsck.f2fs: fix to check all the types of current offsets
We can change the next block offsets sometimes, so we have to check it's
free or not all the time. This fixes that SSR type makes a hole for it.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Thu, 25 Jan 2018 11:45:13 +0000 (19:45 +0800)]
mkfs.f2fs: expand scalability of nat bitmap
Previously, our total node number (nat_bitmap) and total nat segment count
will not monotonously increase along with image size, and max nat_bitmap size
is limited by "CHECKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1", it is
with bad scalability when user wants to create more inode/node in larger image.
So this patch tries to relieve the limitation, by default, limitting total nat
entry number with 20% of total block number.
Before:
image_size(GB) nat_bitmap sit_bitmap nat_segment sit_segment
16 3836 64 36 2
32 3836 64 72 2
64 3772 128 116 4
128 3708 192 114 6
256 3580 320 110 10
512 3260 640 100 20
1024 2684 1216 82 38
2048 1468 2432 44 76
4096 3900 4800 120 150
After:
image_size(GB) nat_bitmap sit_bitmap nat_segment sit_segment
16 256 64 8 2
32 512 64 16 2
64 960 128 30 4
128 1856 192 58 6
256 3712 320 116 10
512 7424 640 232 20
1024 14787 1216 462 38
2048 29504 2432 922 76
4096 59008 4800 1844 150
Add a new option '-i' to control turning on/off this feature.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Yunlei He [Mon, 29 Jan 2018 03:22:14 +0000 (11:22 +0800)]
fsck.f2fs: reduce mem alloc during read sit block
This patch reduce mem alloc during read sit block
Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Yunlei He [Mon, 29 Jan 2018 09:37:41 +0000 (17:37 +0800)]
fsck.f2fs: read ahead xattr & direct node blocks
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 encountering error.
Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: Fix a bug breaking the right order.]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu [Tue, 30 Jan 2018 11:23:12 +0000 (19:23 +0800)]
dump.f2fs: support to dump dirent from blkaddr
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[..] len[0x2] hash[0x0] ino[0x3] type[0x2]
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Wed, 31 Jan 2018 01:24:57 +0000 (17:24 -0800)]
fsck.f2fs: allow -p without value
This patch allows -p without value.
Suggested-by: Pavol Cupka <pavol.cupka@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Junling Zheng [Thu, 3 May 2018 11:25:06 +0000 (19:25 +0800)]
sload.f2fs: fix the missing of bit mask for file type
Fix the missing of bit mask for the file type bit fields.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Lianjun Huang [Mon, 7 May 2018 18:54:14 +0000 (11:54 -0700)]
sload.f2fs: give correct file type
This fixes permission error due to wrong file type.
Signed-off-by: Lianjun Huang <huanglianjun@vivo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Mon, 7 May 2018 18:49:58 +0000 (11:49 -0700)]
fsck.f2fs: fix check order in -p1
Checking nat entries with nat_area_bitmap should be done before quota check,
since fsck_chk_quota_node() unsets quota inode numbers in nat_area_bitmap.
It causes for -p1 to conduct full scan.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Tue, 1 May 2018 20:54:25 +0000 (13:54 -0700)]
f2fs-tools: get kernel version via uname(2)
This patch introduces uname(2) to get kernel version.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim [Tue, 1 May 2018 02:33:10 +0000 (19:33 -0700)]
mkfs.f2fs: avoid selinux denial for unnecessary sysfs node
This avoids unnecessary sysfs node access causing selinux denial.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>