Commit Graph

947 Commits

Author SHA1 Message Date
lipengzheng
7fe92abc96 README.OpenSource format modification
Signed-off-by: lipengzheng <lipengzheng1@huawei.com>
2022-05-26 18:31:53 +08:00
openharmony_ci
f89bd9765c
!15 Rename file README to README.md
Merge pull request !15 from xlfeng/master
2022-05-11 12:54:41 +00:00
xlfeng
7e91b3315e Rename file README to README.md
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2022-05-11 19:10:55 +08:00
openharmony_ci
045b625c0f
!14 单个模块扫描(三方软件)结果清零.
Merge pull request !14 from xlfeng/master
2022-02-16 12:38:46 +00:00
xlfeng
9119bc976e 单个模块扫描(三方软件)结果清零.
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2022-02-16 16:22:31 +08:00
openharmony_ci
fd06df1145
!13 change component name: storage_service
Merge pull request !13 from jiahaoluo/master
2022-02-10 03:22:50 +00:00
jiahaoluo
567e0db420 change part name to storage_service
Signed-off-by: jiahaoluo <luojiahao5@huawei.com>
2022-02-09 15:01:50 +08:00
openharmony_ci
b4d363f7c6
!12 feat: add bundle.json
Merge pull request !12 from pjscc/master
2022-01-25 02:26:13 +00:00
pjscc
2a13fb1aa4 feat: add bundle.json
Signed-off-by: pjscc <pangjiashuai@huawei.com>
2022-01-24 17:07:48 +08:00
openharmony_sig_ci
8ad3abc96f
!11 Add BUILD.gn file.
Merge pull request !11 from xlfeng/master
2022-01-13 07:31:27 +00:00
xlfeng
34e66a7e46 Add BUILD.gn file.
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2022-01-13 15:26:44 +08:00
openharmony_sig_ci
ba2974652d
!10 gn文件格式刷新,subsystem_name的值改为filemanagement,路径/e2fsprogs/f2fs-tools-1.14.0改为/f2fs-tools/,config名称e2fsprogs-defaults改为f2fs-defaults 。fsck/BUILD.gn增加symlink_target_name。
Merge pull request !10 from xlfeng/master
2022-01-13 02:26:18 +00:00
xlfeng
a48316a6e8 BUILD,gn文件中subsystem_name的值改为filemanagement,路径/e2fsprogs/f2fs-tools-1.14.0改为/f2fs-tools/,config名称e2fsprogs-defaults改为f2fs-defaults。fsck/BUILD.gn增加symlink_target_name。
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2022-01-12 17:11:18 +08:00
openharmony_sig_ci
5f5b79da7e !8 Delete the added file README.md, use the README in the source code.
Merge pull request !8 from xlfeng/master
2021-12-24 07:03:07 +00:00
xlfeng
212e242c12 Delete the added file README.md, use the README in the source code.
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2021-12-22 14:54:14 +08:00
openharmony_sig_ci
f18a2cbd20 !6 BUILD.gn and config.h modify Huawei license to GPL-2.0 license.Add #ifndef CONFIG_H #define CONFIG_H on the head of file and #endif on the end of config.h. Modify README.OpenSource.
Merge pull request !6 from xlfeng/master
2021-12-21 10:57:21 +00:00
xlfeng
a2b0c9daf5 BUILD.gn delete comment lines and uncompiled items.
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2021-12-21 15:27:01 +08:00
xlfeng
059d1b3f4c BUILD.gn and config.h modify Huawei license to GPL-2.0 license.Add #ifndef CONFIG_H #define CONFIG_H on the head of file and #endif on the end of config.h. Modify the value of Name in README.OpenSource.
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2021-12-20 21:44:20 +08:00
openharmony_sig_ci
ba906b632e !3 config.h add Huawei License Heade.
Merge pull request !3 from xlfeng/master
2021-12-16 06:21:20 +00:00
xlfeng
197ff72f52 config.h add License Heade
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2021-12-15 11:25:46 +08:00
openharmony_sig_ci
17b687a472 !2 Build successful,add one config.h and four BUILD.gn, modify seven files to relsove macro redefined.Add OAT related files,OAT.xml,README.OpenSource and README.md.
Merge pull request !2 from xlfeng/master
2021-12-15 03:14:48 +00:00
xlfeng
81c31712a5 Build successful,add one config.h and four BUILD.gn, modify seven files to relsove macro redefined,.Delete two Android.bp files.Add OAT related files,OAT.xml,README.OpenSource and README.md.
Signed-off-by: xlfeng <xulifeng7@huawei.com>
2021-12-15 10:45:47 +08:00
Jaegeuk Kim
d41dcbdf46 f2fs-tools: release 1.14.0
This release includes mainly, but not limited to:
 - add IO cache to speed up fsck.f2fs run
 - support casefolding
 - support data compression
 - support zns zone-capacity
 - enhance fsck.f2fs for zoned device
 - enhance f2fs_io tool

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-24 14:55:54 -07:00
Theotime Combes
bbfab0dd6b mkfs.f2fs: add -r (fake_seed) flag
r flag sets the checkpointing seed to 0 (initially used to
remove randomness for apex generation)

Signed-off-by: Theotime Combes <tcombes@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-20 09:22:57 -07:00
Theotime Combes
5c723d1713 mkfs.f2fs: add -T flag
T flag sets timestamps to a given value

Signed-off-by: Theotime Combes <tcombes@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-20 09:22:48 -07:00
Daeho Jeong
f7029e2cf2 sload.f2fs: handle root mount point properly when setting file attribute
Need to remove "/" of mount point name from the file path name
when mount point is "/". Otherwise, we will transfer file path
name whose first two characters are like "//" to fs_config function.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-20 09:08:34 -07:00
Aravind Ramesh
f8410857b7 f2fs-tools: zns zone-capacity support
NVM Express Zoned Namespace (ZNS) devices can have zone-capacity(zc) less
than the zone-size. ZNS defines a per zone capacity which can be equal
or less than the zone-size. Zone-capacity is the number of usable blocks
in the zone. If zone-capacity is less than zone-size, then the segments
which start at/after zone-capacity are considered unusable. Only those
segments which start before the zone-capacity are considered as usable
and added to the free_segment_count and free_segment_bitmap of the kernel.
In such cases, the filesystem should not write/read beyond the
zone-capacity.

Update the super block with the usable number of blocks and free segment
count in the ZNS device zones, if zone-capacity is less than zone-size.
Set reserved segment count and overprovision ratio based on the usable
segments in the zone.

Allow fsck to find the free_segment_count based on the zone-capacity and
compare with checkpoint values.

Signed-off-by: Aravind Ramesh <aravind.ramesh@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
[Jaegeuk Kim: add UNUSED to is_usable_seg()]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-20 09:08:34 -07:00
Jaegeuk Kim
1e3dd7ae5d f2fs_io: measure performance of write()
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-20 09:08:31 -07:00
Jaegeuk Kim
334047bdca f2fs_io: add OSYNC option
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-20 09:08:07 -07:00
Chao Yu
2579fe8099 fsck.f2fs: correct return value
As Norbert Lange reported:

"
$ fsck.f2fs -a /dev/mmcblk0p5; echo $?
Info: Fix the reported corruption.
Info: Mounted device!
Info: Check FS only on RO mounted device
Error: Failed to open the device!
255
"

Michael Laß reminds:

"
I think the return value is exactly the problem here. See fsck(8) (
https://linux.die.net/man/8/fsck) which specifies the return values.
Systemd looks at these and decides how to proceed:

a859abf062/src/fsck/fsck.c (L407)

That means, if fsck.f2fs returns 255, then
the FSCK_SYSTEM_SHOULD_REBOOT bit is set and systemd will reboot.
"

So the problem here is fsck.f2fs didn't return correct value to userspace
apps, result in later unexpected behavior of rebooting, let's fix this.

Reported-by: Norbert Lange <nolange79@gmail.com>
Reported-by: Michael Laß <bevan@bi-co.net>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: fix FSCK_ERROR_CORRECTED]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-17 23:52:38 -07:00
Daeho Jeong
5c92399f8f f2fs_io: open file in read only mode for pinning file
To use "pinfile" command even with read only file, changed open
mode for it.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-08-04 17:52:56 -07:00
Jaegeuk Kim
3aef9bc820 mkfs.f2fs: add casefolding and project quota config
This can be used for Android build support.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-20 17:39:02 -07:00
Jaegeuk Kim
ec0f3c910e mkfs.f2fs: should initialize sparse file in Windows
Otherwise it fails to format in Windows.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-20 17:39:02 -07:00
Jaegeuk Kim
17463f9c42 f2fs_io: add mmap read operation
This patch adds an option, mmap, when reading data.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-20 17:39:02 -07:00
Theotime Combes
391e490a12 fsck.f2fs: avoid randomness in sum_blk
This patch removes random bytes in sum_blk when loading a new directory.

Signed-off-by: Theotime Combes <tcombes@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-15 18:12:28 -07:00
Jaegeuk Kim
aac7f4cb42 dump.f2fs: check block address first before reading the block
This should avoid to read out wrong block address.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-15 10:30:03 -07:00
Jaegeuk Kim
e767223422 sload.f2fs: fix missing fsck_init
This patch allocates some data structures that will be used for loading files
on existing image.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-15 10:29:57 -07:00
Zoltán Böszörményi
31acef0417 mkfs.f2fs: allow setting volume UUID manually
This patch adds an option to assign UUID manually.

Usage:
 # mkfs.f2fs -U uuid_string

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-09 19:58:05 -07:00
Robin Hsu
d03cab6c93 fsck.f2fs: Split build_segment_manager() to speed up auto-fix
Speed up fsck in auto-fix mode by splitting
build_segment_manager() into two disjoint parts:
	early_build_segment_manager(), and
	late_build_segment_manager(),
where in some cases (when !need_fsync_data_record(), or cannot
find_fsync_inode()), late_build_segment_manager() won't be needed in
auto-fix mode.  This speeds up a little bit in those cases.

Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-09 18:16:58 -07:00
Jaegeuk Kim
e3c4e1f89a dump.f2fs: dump symlink contents in lost_found
Let's allow to show symlink path.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-07-06 20:13:11 -07:00
Robin Hsu
0d0158cf23 fsck.f2fs: Fix slow fsck in auto-fix mode
Split f2fs_init_nid_bitmap() into two disjoint parts:
	f2fs_early_init_nid_bitmap(), and
	f2fs_late_init_nid_bitmap(),
where f2fs_late_init_nid_bitmap() won't be called in auto-fix mode, when
no errors were found.

f2fs_late_init_nid_bitmap() contains the loop to create NID bitmap from
NAT. which is the main reason for slow fsck.

Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-29 08:48:21 -07:00
Robin Hsu
e66e4c1f3b fsck: prevent buffer overrun in quota code
A maliciously corrupted file systems can trigger buffer overruns in
the quota code used by fsck.

To fix it, quota file sizes are checked against real allocated
block index tables (inode, direct nodes, indirect nodes, double
indirect nodes).  If the size mismatches, the quota file is considered
corrupted and will be regenerated.

Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-23 16:58:44 -07:00
Wuyun Zhao
712aca364f f2fs-tools: set cold flag for non-dir node
Signed-off-by: Wuyun Zhao <zhaowuyun@wingtech.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-18 12:38:18 -07:00
Rolf Eike Beer
895b26e118 lib: pass all needed include paths to libf2fs
Otherwise the paths to uuid and blkid headers extracted from pkg-config are not
respected.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-18 12:34:29 -07:00
Rolf Eike Beer
4b55c43828 lib: use ${libuuid_LIBS} instead of -luuid everywhere
Otherwise linking will fail if the library is in an uncommon location or has a
non-standard name.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-18 12:34:23 -07:00
Rolf Eike Beer
1ceb06bfcc lib: fix include path for blkid.h
$ pkg-config --cflags blkid
-I/usr/include/blkid

The "blkid/" directory is actually part of the include path. This usually still
works because most people have the path one level up in their default include
path.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-18 12:34:13 -07:00
Rolf Eike Beer
59a37413f8 lib: fix include path for uuid.h
$ pkg-config --cflags uuid
-I/usr/include/uuid

The "uuid/" directory is actually part of the include path. This usually still
works because most people have the path one level up in their default include
path.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-18 12:34:03 -07:00
Jaegeuk Kim
a60cd1a3f9 libf2fs: fix build error on Windows
Windows doesn't support S_ISREG, so let's avoid depedency.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-06-08 11:37:28 -07:00
Eric Biggers
e65d9c7adf fsck.f2fs: fix dirent position check for encrypted+casefolded dentries
fsck.f2fs reports corruption if the filesystem contains any encrypted +
casefolded directories with any substantial number of dentries:

    [ASSERT] (f2fs_check_dirent_position:1374)  --> Wrong position of dirent pino:8, name:۟�[I�^*�(�5~�}�D��#]7�8�ˎ�, level:1, dir_level:0, pgofs:4, correct range:[2, 3]

The problem is that f2fs_check_dirent_position() computes the wrong hash
for encrypted+casefolded dentries.  It's not actually possible for it to
compute the correct hash, because it would need the encryption key.

However, the on-disk dentry already contains the hash code, and its
correctness was already verified by f2fs_check_hash_code() if possible.

So, make f2fs_check_dirent_position() use the hash code from disk rather
than recompute it.

Also fix it to print the filename in human-readable form.

This bug was causing 'kvm-xfstests -c f2fs/encrypt -g casefold'
to fail with the test_dummy_encryption_v2 and encryption+casefolding
kernel patches applied.

Fixes: 7f3767ee8d ("f2fs-tools: Casefolded Encryption support")
Cc: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-05-30 08:18:51 -07:00
Daeho Jeong
b23b2b97a6 f2fs_io: add randread
I've added a new command to evaluate random read.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-05-27 13:59:25 -07:00