Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
cp_payload is set differently [1] when extended node bitmap feature is
enabled. Commit b79c3ba4ea9d broke fsck on f2fs file systems created on
2+ TB device with extended node bitmap feature enabled.
As the sanity check is for checking overflows, fix this to assume the max
possible cp_payload size under the extended node bitmap.
Link: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/tree/mkfs/f2fs_format.c?h=v1.15.0#n372 [1]
Fixes: b79c3ba4ea9d ("fsck.f2fs: sanity check cp_payload before reading checkpoint")
Reported-by: Alexander Koskovich <akoskovich@pm.me>
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Show info w/o it.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Report_zone is not supported on normal partition.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Let's relax this for Android support.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
We need to check the first disk only, and trim the other disks.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
TOTAL_SEGS should include metadata segments and main segments.
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Relative path does not work when searching for include files
when srcdir != builddir
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Keep sanity_check_raw_super flow in fsck.f2fs being consistent w/
sanity_check_raw_super() in f2fs kernel module, otherwise, it outputs
different error information when mounting/fscking the same image which
contains corrupted superblock.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Let's remove this.
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Remove the sg_write_buffer source code and build rules now that the
sg3_utils project has been imported.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
There is no need to recalculate ADDRS_PER_INODE and ADDRS_PER_BLOCK,
especially in a for loop.
Signed-off-by: Sheng Yong <shengyong@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
If i_namelen is corrupted, there may be an overflow when doing memcpy.
Signed-off-by: Sheng Yong <shengyong@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Sheng Yong <shengyong@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Option "-g" for dump.f2fs is unavailable and not used in dump.f2fs.
Signed-off-by: Sheng Yong <shengyong@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
HAVE_CLOCK_GETTIME wasn't defined during autoconf, leading to
messages like "Done: 0.000000 secs" on Linux distros.
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Added options in f2fs_io write command to support
F2FS_IOC_START_ATOMIC_REPLACE.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
As f2fs becomes more resilient for GCs, let's give the marginal overprovision
space back to user.
Fix an issue where reserved_space > ovp_space, reported by Shinichiro.
Signed-off-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
It'd be good to generate zone-aware sequential writes to both of HA and HM
zoned devices.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
We need to set the c.zoned_model appropriately for further usages.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
In auto/preen mode, let's trigger repairing if filesystem has
inconsistent errors.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
In auto/preen mode, let's trigger repairing if filesystem was forced
to stop.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Change to calculate and export max image size with valid blocks
used of image rather than last used block of image.
[FSCK] Max image size: xx MB, Free space: xx MB
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Update allocation policy for ro feature:
- hot_data: allocating blocks by LBA ascending order
- hot_node: allocating blocks by LBA descending order
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
The calculation is wrong, fix it.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Change-Id: Ic903ce09c93de75d6deb700a5a283638a912a25b
Test: fastboot erase userdata
|
|
LZ4_STREAMSIZE_U64 is undefined in new lz4 lib.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Make the argument list match the format string. Use PRIu64 for uint64_t
and %zu for size_t.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
We now use walltime for monthly period check. However the walltime is:
* unstable(timestamp register reset) and settable(modified by user)
* unreasonable(e.g: device power-off for one month, no data changed)
When the walltime changes to the past before one month or the future
after one month, the period check in next fsck will fail to skip or
start a full scan. So, let's use the elapsed_time in checkpoint as
current time for period check.
Signed-off-by: Weichao Guo <guoweichao@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Cleanly report an error instead of dividing by 0 (causing a floating
point exception) in the following case:
truncate -s 16M img && mkfs.f2fs img
Note that this is a minimal fix; it appears that overly-small images
still cause various integer overflows in f2fs_prepare_super_block().
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
We don't need to check the running kernel configuration.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Support 'gc' sub command to trigger filesystem GC via ioctl in f2fs.
Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
AC_CHECK_LIB seems to not work correctly with OpenWrt. Add possibility
to disable lz4 and lzo2 manually.
Fixes errors in the form of:
Package f2fsck is missing dependencies for the following libraries:
liblz4.so.1
liblzo2.so.2
Signed-off-by: Nick Hainke <vincent@systemli.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
In the new version the configuration no longer respects the
--without/--with blkid/selinux parameters. Add the tests for
"with_blkid" and "with_selinux" back to configure.ac as described
in the manual.
Link: https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/External-Software.html
Fixes: c48335416a09 ("configure.ac: Enable cross-compilation")
Signed-off-by: Nick Hainke <vincent@systemli.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Since the size of struct f2fs_summary_block equals F2FS_BLKSIZE, use
F2FS_BLKSIZE instead of PAGE_CACHE_SIZE as the size of struct
f2fs_summary_block.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Use F2FS_BLKSIZE instead of PAGE_SIZE for dev_read_block() buffers since
dev_read_block() reads F2FS_BLKSIZE bytes.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Change the type of the third argument of f2fs_report_zone() from void *
into struct blk_zone * to enable type checking.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
The definition of struct blk_zone_report is as follows:
struct blk_zone_report {
__u64 sector;
__u32 nr_zones;
__u32 flags;
struct blk_zone zones[0];
};
Since f2fs_report_zone() allocates the above data structure with
malloc() and since f2fs_report_zone() only initializes the sector and
nr_zones members, the flags member is not initialized. Modify
f2fs_report_zone() such that 0 is passed as flags to the
BLKREPORTZONE ioctl instead of a random value. This has been
discovered by reading the source code.
Cc: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fixes: 6d7c7b785feb ("libf2fs_zoned: Introduce f2fs_report_zone() helper function")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Fix the struct f2fs_dentry_block definition on systems for which
PAGE_SIZE != 4096. This patch does not change the struct f2fs_dentry_block
definition if PAGE_SIZE == 4096.
Cc: Peter Collingbourne <pcc@google.com>
Reported-by: Peter Collingbourne <pcc@google.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Reviewed-by: Peter Collingbourne <pcc@google.com>
Tested-by: Peter Collingbourne <pcc@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Make.f2fs supports manually specifying overprovision, and we expect
resize.f2fs to support it as well.
This change add a new '-o' option to manually specify overprovision,
and fix to check free space before grow. Otherwise, after grow,
kernel may report below error message when we mount the image if -o
parameter is specified during resize:
F2FS-fs (loop0): invalid crc_offset: 0
F2FS-fs (loop0): Wrong valid_user_blocks: 16404, user_block_count: 13312
F2FS-fs (loop0): Failed to get valid F2FS checkpoint
mount(2) system call failed: Structure needs cleaning.
Signed-off-by: liuchao12 <liuchao12@xiaomi.com>
Signed-off-by: qixiaoyu1 <qixiaoyu1@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
The kernel enforced not to have compression and inline_data bits
together, but old kernel created files with them. Let's disable
compression in that case.
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Some device like android phone doesn't show the dev number path in
/dev/block/, for example:
$ ls /dev/block/
bootdevice dm-6 loop24 loop43 ram13 sda5 sdd4 sde24 sde43 sde62 sdf1
by-name dm-7 loop25 loop44 ram14 sda6 sdd5 sde25 sde44 sde63 sdf10
dm-0 dm-8 loop26 loop45 ram15 sda7 sdd6 sde26 sde45 sde64 sdf11
dm-1 dm-9 loop27 loop46 ram2 sda8 sdd7 sde27 sde46 sde65 sdf12
dm-10 loop0 loop28 loop47 ram3 sda9 sde sde28 sde47 sde66 sdf13
dm-11 loop1 loop29 loop48 ram4 sdb sde1 sde29 sde48 sde67 sdf14
dm-12 loop10 loop3 loop49 ram5 sdb1 sde10 sde3 sde49 sde68 sdf15
dm-13 loop11 loop30 loop5 ram6 sdb2 sde11 sde30 sde5 sde69 sdf16
dm-14 loop12 loop31 loop50 ram7 sdb3 sde12 sde31 sde50 sde7 sdf17
dm-15 loop13 loop32 loop51 ram8 sdb4 sde13 sde32 sde51 sde70 sdf18
dm-16 loop14 loop33 loop6 ram9 sdb5 sde14 sde33 sde52 sde71 sdf19
dm-17 loop15 loop34 loop7 sda sdc sde15 sde34 sde53 sde72 sdf2
dm-18 loop16 loop35 loop8 sda1 sdc1 sde16 sde35 sde54 sde73 sdf3
dm-19 loop17 loop36 loop9 sda10 sdc2 sde17 sde36 sde55 sde74 sdf4
dm-2 loop18 loop37 mapper sda11 sdc3 sde18 sde37 sde56 sde75 sdf5
dm-20 loop19 loop38 platform sda12 sdc4 sde19 sde38 sde57 sde76 sdf6
dm-21 loop2 loop39 ram0 sda13 sdc5 sde2 sde39 sde58 sde77 sdf7
dm-3 loop20 loop4 ram1 sda14 sdd sde20 sde4 sde59 sde78 sdf8
dm-4 loop21 loop40 ram10 sda2 sdd1 sde21 sde40 sde6 sde8 sdf9
dm-5 loop22 loop41 ram11 sda3 sdd2 sde22 sde41 sde60 sde9 vold
dm-53 loop23 loop42 ram12 sda4 sdd3 sde23 sde42 sde61 sdf zram0
this will cause stat_bdev cannot show bdev information.
But most of devices (include android) show dev number path in /sys/dev/block, for example:
$ ls /sys/dev/block
1:0 254:1 254:6 259:21 259:38 259:54 7:104 7:24 7:368 8:11 8:4 8:70 8:87
1:1 254:10 254:7 259:22 259:39 259:55 7:112 7:240 7:376 8:12 8:48 8:71 8:88
1:10 254:11 254:8 259:23 259:4 259:56 7:120 7:248 7:384 8:13 8:49 8:72 8:89
1:11 254:12 254:9 259:24 259:40 259:57 7:128 7:256 7:392 8:14 8:5 8:73 8:9
1:12 254:13 259:0 259:25 259:41 259:58 7:136 7:264 7:40 8:16 8:50 8:74 8:90
1:13 254:14 259:1 259:26 259:42 259:59 7:144 7:272 7:400 8:17 8:51 8:75 8:91
1:14 254:15 259:10 259:27 259:43 259:6 7:152 7:280 7:408 8:18 8:52 8:76 8:92
1:15 254:16 259:11 259:28 259:44 259:60 7:16 7:288 7:48 8:19 8:53 8:77 8:93
1:2 254:17 259:12 259:29 259:45 259:61 7:160 7:296 7:56 8:2 8:54 8:78 8:94
1:3 254:18 259:13 259:3 259:46 259:62 7:168 7:304 7:64 8:20 8:55 8:79 8:95
1:4 254:19 259:14 259:30 259:47 259:63 7:176 7:312 7:72 8:21 8:6 8:8
1:5 254:2 259:15 259:31 259:48 259:64 7:184 7:32 7:8 8:3 8:64 8:80
1:6 254:20 259:16 259:32 259:49 259:65 7:192 7:320 7:80 8:32 8:65 8:81
1:7 254:21 259:17 259:33 259:5 259:66 7:200 7:328 7:88 8:33 8:66 8:82
1:8 254:3 259:18 259:34 259:50 259:7 7:208 7:336 7:96 8:34 8:67 8:83
1:9 254:4 259:19 259:35 259:51 259:8 7:216 7:344 8:0 8:35 8:68 8:84
253:0 254:5 259:2 259:36 259:52 259:9 7:224 7:352 8:1 8:36 8:69 8:85
254:0 254:53 259:20 259:37 259:53 7:0 7:232 7:360 8:10 8:37 8:7 8:86
so change the access path from /dev/block to /sys/dev/block
(same method of libudev)
Before:
$./f2fs.fibmap testfile_4k
----------------file info-------------------
testfile_4k :
--------------------------------------------
dev [254:53]
ino [0x 3dda : 15834]
mode [0x 81b6 : 33206]
nlink [0x 1 : 1]
uid [0x 0 : 0]
gid [0x 0 : 0]
size [0x 40000 : 262144]
blksize [0x 1000 : 4096]
blocks [0x 200 : 512]
--------------------------------------------
file_pos start_blk end_blk blks
0 2256926 2256987 62
253952 2150337 2150338 2
Patched:
$./f2fs.fibmap testfile_4k
----------------bdev info-------------------
devname = 254:53
start_lba = 0
----------------file info-------------------
testfile_4k :
--------------------------------------------
dev [254:53]
ino [0x 3dda : 15834]
mode [0x 81b6 : 33206]
nlink [0x 1 : 1]
uid [0x 0 : 0]
gid [0x 0 : 0]
size [0x 40000 : 262144]
blksize [0x 1000 : 4096]
blocks [0x 200 : 512]
--------------------------------------------
file_pos start_blk end_blk blks
0 2256926 2256987 62
253952 2150337 2150338 2
Signed-off-by: Ben Chang <ben.chang@sonicsky.net>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This adds a write option having O_DIRECT | O_DSYNC.
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
fibmap: Fix file too large causing file_pos overflow
fibmap show file_pos with incorrectly value when passing a large file.
Before:
----------------file info-------------------
/data/media/0/data1 :
--------------------------------------------
dev [254:18]
ino [0x 4db1 : 19889]
mode [0x 81b0 : 33200]
nlink [0x 1 : 1]
uid [0x 280e : 10254]
gid [0x 3ff : 1023]
size [0x1b3dca314 : 7312548628]
blksize [0x 1000 : 4096]
blocks [0x da2530 : 14296368]
--------------------------------------------
file_pos start_blk end_blk blks
0 3197602 3198463 862
3530752 3197509 3197509 1
3534848 3197557 3197578 22
3624960 3198464 3396701 198238
815607808 3396703 3632480 235778
1781354496 3632482 3652095 19614
1861693440 3396702 3396702 1
1861697536 3632481 3632481 1
1861701632 1514948 1514948 1
1861705728 1518774 1518774 1
1861709824 2543104 2543125 22
...
1862111232 2457813 2457813 1
1862115328 3652096 3878168 226073
-1506856960 3878170 4133725 255556
-460099584 1510048 1510052 5
Patched:
----------------file info-------------------
/data/media/0/data1 :
--------------------------------------------
dev [254:18]
ino [0x 4db1 : 19889]
mode [0x 81b0 : 33200]
nlink [0x 1 : 1]
uid [0x 280e : 10254]
gid [0x 3ff : 1023]
size [0x1b3dca314 : 7312548628]
blksize [0x 1000 : 4096]
blocks [0x da2530 : 14296368]
--------------------------------------------
file_pos start_blk end_blk blks
0 3197602 3198463 862
3530752 3197509 3197509 1
3534848 3197557 3197578 22
3624960 3198464 3396701 198238
815607808 3396703 3632480 235778
1781354496 3632482 3652095 19614
1861693440 3396702 3396702 1
1861697536 3632481 3632481 1
1861701632 1514948 1514948 1
1861705728 1518774 1518774 1
1861709824 2543104 2543125 22
...
1862111232 2457813 2457813 1
1862115328 3652096 3878168 226073
2788110336 3878170 4133725 255556
3834867712 1510048 1510052 5
Signed-off-by: Dylan Chang <dylan.chang@oneplus.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Usage:
dump.f2fs -I [inode nid] /dev/sda
This feature can be useful for some bugs caused by system crash.
We not only need dump current valid node page, but alse the history
data in disk, which can give some clues for status change of the inode.
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
[Jaegeuk Kim: fix build error]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This allows f2fs_io report latency.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/os/base.h:128:23: error: missing ')' after 'do'
^~~~~~~~~~~
external/f2fs-tools/include/f2fs_fs.h:81:24: note: expanded from macro 'fallthrough'
~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/os/base.h:128:22: note: to match this '('
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
libf2fs.c:883:12: warning: unused function 'is_power_of_2' [-Wunused-function]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This reverts commit adcec10b4dee ("Support zoned device if libc exists).
Signed-off-by: Martin Stjernholm <mast@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
|
|
Instead, we should use <config.h> generated by configure.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
external/f2fs-tools/mkfs/f2fs_format_utils.c:51:28: error: unused parameter 'i' [-Werror,-Wunused-parameter]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Android security team does not allow to use SG_IO.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
We need to get the definitions first.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
The new fsck progress should not be used for file_map.
Reported-by: Michael Benedict <michaelbenedicttjahya@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch fixes wrong segment/section print-outs.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Compressed cluster content includes compress cluster header, so
calculation of dstlen parameter in LZ4_compress_fast_extState()
should consider this design, otherwise compressed data may overflow
destination buffer during compression.
Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This requires to change Android.bp in AOSP.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Change-Id: I28a4a701513cb2420cdf0e0e2aa3f60e712f2fcb
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Make the Github continuous integration checks more strict.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
__SANE_USERSPACE_TYPES__ must be defined before <linux/types.h> is
included. Hence this patch that moves the definition of that macro into
the source files that need it.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
|
|
This patch prevents that older compilers report the following warning:
f2fs_format.c: In function ‘f2fs_prepare_super_block’:
../include/f2fs_fs.h:350:26: error: conversion from ‘unsigned int’ to ‘__uint16_t’ {aka ‘short unsigned int’} changes value from ‘4076150800’ to ‘8208’ [-Werror=overflow]
350 | #define F2FS_SUPER_MAGIC 0xF2F52010 /* F2FS Magic Number */
| ^~~~~~~~~~
../include/f2fs_fs.h:574:49: note: in expansion of macro ‘cpu_to_le16’
574 | #define set_sb_le16(member, val) (sb->member = cpu_to_le16(val))
| ^~~~~~~~~~~
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Just like in the Linux kernel source code, annotate switch/case
fallthrough.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
It is recommended to test a HAVE_* macro instead of directly testing the
host type in source code. Hence this patch.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Make it possible to check whether the return value of ioctl() is negative.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Since 'remained_blkentries' is unsigned, the assert statement that
verifies whether that variable is positive will never fail. Hence
remove that assert statement.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Suppress the following compiler warning:
main.c:37:14: warning: unused function 'absolute_path' [-Wunused-function]
static char *absolute_path(const char *file)
^
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Suppress the following compiler warning:
f2fs_format.c:1653:37: warning: adding 'int' to a string does not append to the
string [-Wstring-plus-int]
memcpy(dent_blk->filename[3], LPF + F2FS_SLOT_LEN,
~~~~^~~~~~~~~~~~~~~
f2fs_format.c:1653:37: note: use array indexing to silence this warning
memcpy(dent_blk->filename[3], LPF + F2FS_SLOT_LEN,
^
& [ ]
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
The selinux/android.h header file is available in Android but not in the
Android NDK. Hence this patch that detects presence of that header file
at configure time.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
The <sparse/sparse.h> header is available in Android but not in the
Android NDK. Hence this patch that only includes the sparse header file
if it is available.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Fix multiple compiler warnings and build errors reported by the MinGW
cross-compiler.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Use %zu to format size_t as required by the POSIX standards.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Prepare for enabling -Wmacro-redefined.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Move the be32_to_cpu() definition next to the little endian conversion
functions. This patch improves portability since the MinGW ntohl()
function exists in another library than the C library.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Applying the __attribute__((packed)) annotation to members that do not
need it impacts performance negatively on architectures that do not
support efficient unaligned accesses (e.g. ARMv7). Hence minimize the
__attribute__((packed)) annotations.
See also CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS in the Linux kernel.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Use uint64_t instead of __u64 in the definitions of the endianness
conversion macros. This patch fixes the following compiler warning:
dir.c: In function ‘f2fs_create’:
dir.c:785:16: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 12 has type ‘long long unsigned int’ [-Wformat=]
785 | MSG(1, "Info: Create %s -> %s\n"
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/f2fs_fs.h:252:32: note: in definition of macro ‘MSG’
252 | printf(fmt, ##__VA_ARGS__); \
| ^~~
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Suppress the following compiler warning:
segment.c:698:12: warning: ‘n’ may be used uninitialized in this function [-Wmaybe-uninitialized]
698 | if (n < 0)
| ^
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Before modifying the __attribute__((packed)) annotations, let the
compiler verify the sizes of on-disk data structures.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Prepare for verifying structure sizes with static_assert().
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
For those who use Github to contribute f2fs-tools patches, let the
github servers build the f2fs-tools source code upon every push and pull
requests. This change does not affect users who do not use Github.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This makes it easier to build f2fs-tools for Windows.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Many format strings use one of the PRI* macros. These macros are compatible
with the uint types but not with the u_int types. Hence this patch
that switches from the u_int to the uint types.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Stop using PKG_CHECK_MODULES() since that macro is not compatible with
cross-compilation.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch fixes the following automake warnings:
/usr/share/automake-1.16/am/ltlibrary.am: warning: 'libf2fs.la': linking libtool libraries using a non-POSIX
/usr/share/automake-1.16/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
lib/Makefile.am:3: while processing Libtool library 'libf2fs.la'
/usr/share/automake-1.16/am/ltlibrary.am: warning: 'libf2fs_format.la': linking libtool libraries using a non-POSIX
/usr/share/automake-1.16/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
mkfs/Makefile.am:11: while processing Libtool library 'libf2fs_format.la'
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Since no code uses the HAVE_.*_PROTOTYPE macros, remove the code that
sets these macros.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Run autoupdate v2.71 to fix the following autogen.sh warnings:
configure.ac:33: warning: The macro `AC_CONFIG_HEADER' is obsolete.
configure.ac:33: You should run autoupdate.
./lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from...
configure.ac:33: the top level
configure.ac:49: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:49: You should run autoupdate.
m4/libtool.m4:100: AC_PROG_LIBTOOL is expanded from...
configure.ac:49: the top level
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
f2fs currently only work with zoned storage devices with a zone
size which is a power of 2 (PO2). So check if a non-power of 2
zoned device is found, and if so disallow its use. This prevents
users from incorrectly using these devices.
This is a non-issue today given today's kernel does not allow NPO2
zoned devices to exist as a block device. But NPO2 zoned devices do exist
so proactively put a stop-gap measure in place to prevent it from being
incorrectly used.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This gives an information of "-g android".
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
A specific define is needed. Fixes mostly issues with -Wformat.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
With this patch, "-g android" enables project quota only by default, if the
kernel is over v4.14. Otherwise, it enables usr/grp/proj all together.
1) -O quota : enables usr/grp
2) -O project_quota -O extra_attr : enabled prj
3) -O quota -O project_quota -O extra_attr : enables usr/grp/proj
4) -g android : enables proj (4.14+), usr/grp/proj (old kernel)
5) -g android -O project_quota -O extra_attr : enables usr/grp/proj
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Added two option to f2fs_io "write" command.
- atomic_commit : atomic write & commit
- atomic_abort : atomic write & abort
Also, added an optional option {delay}, which is in ms unit and optional
only for atomic_commit and atomic_abort.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch modifies enabling quota options in which enables user/group quotas
only if user specifies the "-O quota" especially.
1) -O quota : enables usr/grp
2) -O project_quota -O extra_attr : enabled prj
3) -O quota -O project_quota -O extra_attr : enables usr/grp/proj
4) -g android : enables usr/grp
5) -g android -O project_quota -O extra_attr : enables usr/grp/proj
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
On large SSDs filled with lots of data, fsck.f2fs can be very long to finish.
For instance, on my 1TB SSD filled at 99%, it takes literally 5 minutes to
complete.
Currently, the only way to have some feedback is to enable debug output,
but it is very verbose and doesn't tell the actual progress.
This patch implements a simple progress report in the longest
running part of the check (in fsck_chk_node_blk).
The number of checked node / total valid nodes is printed
every 1000 nodes checked, and the percentage of progress
is also calculated and printed.
Signed-off-by: Antoine Viallon <antoine@lesviallon.fr>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This case is not a bug, so we should fix seamlessly.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
When we check other corrupted bugs in fsck, we use bug_on. So, if major
bugs are already detected in fsck_verify(), fsck will false alarm that
there are other bugs, even if there are no other bugs. So, let's fix this.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Even though fsck fixed quota issues, fsck returns failure status and
makes the user code misunderstand like errors are still there.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
not supported
In lower versions than macOS 10.12, they don't support clock_gettime
function. It breaks the build, so we need to fall back to the original
kernel version check algorithm, in that case.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch fixes the below stale magic info.
$ mkfs.btrfs -f test.img
btrfs-progs v5.10.1
See http://btrfs.wiki.kernel.org for more information.
Label: (null)
UUID: 941d2db7-3ece-4090-8b22-c4ea548b5dae
Node size: 16384
Sector size: 4096
Filesystem size: 1.00GiB
Block group profiles:
Data: single 8.00MiB
Metadata: DUP 51.19MiB
System: DUP 8.00MiB
SSD detected: no
Incompat features: extref, skinny-metadata
Runtime features:
Checksum: crc32c
Number of devices: 1
Devices:
ID SIZE PATH
1 1.00GiB test.img
$ hexdump -s 0x10000 -n 128 -C test.img
00010000 81 29 94 0a 00 00 00 00 00 00 00 00 00 00 00 00 |.)..............|
00010010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00010020 94 1d 2d b7 3e ce 40 90 8b 22 c4 ea 54 8b 5d ae |..-.>.@.."..T.].|
00010030 00 00 01 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
00010040 5f 42 48 52 66 53 5f 4d 05 00 00 00 00 00 00 00 |_BHRfS_M........|
00010050 00 40 d2 01 00 00 00 00 00 40 50 01 00 00 00 00 |.@.......@P.....|
00010060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00010070 00 00 00 40 00 00 00 00 00 00 02 00 00 00 00 00 |...@............|
00010080
$ mkfs.f2fs -t 0 -f test.img
F2FS-tools: mkfs.f2fs Ver: 1.14.0 (2020-12-28)
Info: Disable heap-based policy
Info: Debug level = 0
Info: Trim is disabled
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 2097152 (1024 MB)
Info: zone aligned segment0 blkaddr: 512
Info: format version with
"Linux version 5.10.46-4rodete1-amd64 (glinux-team@google.com) (gcc-10 (Debian 10.2.1-6+build2) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.46-4rodete1 (2021-08-20)"
Info: Overprovision ratio = 6.360%
Info: Overprovision segments = 68 (GC reserved = 39)
Info: format successful
$hexdump -s 0x10000 -n 128 -C test.img
00010000 c2 8a c8 26 00 00 00 00 00 00 00 00 00 00 00 00 |...&............|
00010010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00010020 92 ab 3f c6 b7 82 49 5e 93 23 e8 c9 e9 45 7d ac |..?...I^.#...E}.|
00010030 00 00 01 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
00010040 5f 42 48 52 66 53 5f 4d 05 00 00 00 00 00 00 00 |_BHRfS_M........|
00010050 00 40 d2 01 00 00 00 00 00 40 50 01 00 00 00 00 |.@.......@P.....|
00010060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00010070 00 00 00 40 00 00 00 00 00 00 02 00 00 00 00 00 |...@............|
00010080
--- After this patch ---
$ mkfs.f2fs -t 0 -f test.img
F2FS-tools: mkfs.f2fs Ver: 1.14.0 (2020-12-28)
Info: Disable heap-based policy
Info: Debug level = 0
Info: Trim is disabled
test.img appears to contain an existing filesystem (btrfs).
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 2097152 (1024 MB)
Info: zone aligned segment0 blkaddr: 512
Info: format version with
"Linux version 5.10.46-4rodete1-amd64 (glinux-team@google.com) (gcc-10 (Debian 10.2.1-6+build2) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.46-4rodete1 (2021-08-20)"
Info: Overprovision ratio = 6.360%
Info: Overprovision segments = 68 (GC reserved = 39)
Info: format successful
$ hexdump -s 0x10000 -n 128 -C test.img
00010000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00010080
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This adds a check to the is_valid_summary function to prevent a segfault
if the calculated offset is out of bounds. Such an offset can for example
occur as the result of corruption of the underlying hardware.
I encountered this segfault on my own phone's sd card, so this is not
just a theoretical concern.
Signed-off-by: Arpad Müller <arpad.mueller@uni-bonn.de>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This tries to avoid build warning.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Update the usage about option of preen mode.
It's difficult to know about preen mode 2, because there is no
description in usage.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Given fiemap way to print out extents in the kernel, we can correctly
print the layout of each file in a unit of extent, not block. So, I
changed fiemap print out way like below.
Fiemap: offset = 0 len = 60
logical addr. physical addr. length flags
0 0000000000000000 00000020032df000 0000000000004000 00001008
1 0000000000004000 00000020032e0000 0000000000004000 00001008
2 0000000000008000 00000020032e1000 0000000000004000 00001008
3 000000000000c000 00000020032e2000 0000000000004000 00001008
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
e.g., f2fs_io rename source dest 1
1. open(source)
2. rename(source, dest)
3. fsync(source)
4. close(source)
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
|
|
* check/fix i_compr_blocks
* check/fix compressed flag in i_flags when compression is not
supported.
Signed-off-by: Robin Hsu <robinhsu@google.com>
[Jaegeuk Kim: minor coding style]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Made "fiemap" command in accordance with user api manual. So, eliminated
NEW_ADDR print out and made it ends in the last extent.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
If the following process returns an error,
the quota inode, not the quota file, is damaged.
(fsck_chk_quota_node-->fsck_chk_node_blk-->sanity_check_nid)
The fsck does not have a process to rebuild the quota inode.
Because sanity_check_nid is not passed, fsck->nat_area_bitmap
can not be cleared, and then the NAT of quota will be nullify
during fix_nat_entries.
During the next fsck check, the quota inode check fails
because the address of the quota inode changes to 0.
In addition, in fsck_chk_quota_files-->f2fs_filesize_update,
data is written to address 0.
Therefore, when the quota inode is corrupted, we need to rebuild it.
Signed-off-by: Wang Xiaojun <wangxiaojun11@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
In previous, we did a full scan right after kernel version is changed
and it triggered many unnecessary full scan whenever a newly built
kernel is downloaded. Plus, we are lack of a periodic health check of
on-disk filesystem images. So, I added a monthly periodic check after
a new vesion is updated.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch cleans up, pointed by Chao.
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
In page_symlink, reserve_new_block applies address for data block,
not for inodes. Therefore, is_inode is set to 0.
Signed-off-by: Wang Xiaojun <wangxiaojun11@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch adds an extent cache for ro partition.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This fixes wrong file offset updates, since we should not do (*ofs)++; for
indirect node blocks.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This option shows all the file names in the disk.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
We don't need to enable all android features for RO.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
For a volume using a zoned block device without conventional zones
(e.g. a NVMe ZNS drive), a regular block device must be used to store
metadata so that in-place metadata writes can be executed. The zoned
block device cannot contain any metadata blocks requiring in-place
update (e.g. bitmap blocks). When formatting a volume that contains
host managed zoned block devices, make sure that the conventional device
used to store metadata is large enough to avoid write errors.
Signed-off-by: Aravind Ramesh <aravind.ramesh@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Since the IMMUTABLE flag for compression is now changed
to F2FS_COMPRESS_RELEASED, some 'IMMUTABLE' words should be changed too:
1. sload help page
2. inline comments
Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Let's use F2FS_COMPRESS_RELEASED to disallow writes only.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch adds a readonly feature on small partitions by eliminating
on-disk layout for data writes such as provisioning/reserved space and
SSA.
This requires f2fs updates to understand RO feature in superblock.
Tested 4 cases:
sload.f2fs -c -a lz0 -f kernel/fs $DEV
sload.f2fs -c -a lz4 -f kernel/fs $DEV
sload.f2fs -c -r -a lz4 -f kernel/fs $DEV
sload.f2fs -c -L 3 -r -a lz4 -f kernel/fs $DEV
after:
mkfs.f2fs -O ro,compression,extra_attr -f $DEV
fsck.f2fs $DEV
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch add an option to print out superblock and checkpoint only.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Although many other filesystems provide a tool for changing volume
label, e.g. e2label for ext filesystem, but f2fs has no way to change
volume label except set it while formatting with mkfs.f2fs.
This introduces f2fslabel, simple tool for changing label of f2fs
volume.
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Current implementation, If define WITH_KERNEL_VERSION
get_kernel_uname_version just return release info, not define
WITH_KERNEL_VERSION, return release and version info.
So remove "!" in get_kernel_uname_version, make logic more clear.
Signed-off-by: lijiazi <lijiazi@xiaomi.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Fix to free node_blk when nid is 0 from dump_node_blk().
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
With invalid node info from fsck_chk_orphan_node(), orphan_blk
and new_blk are not freed. Fix memory leak in the path.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
In not enough segements error path of f2fs_write_check_point_pack(),
cp_payload is not freed. Fix the error path.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Alloced nat_block doesn't freed from migrate_nat(). Fix to free
nat_block.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch fixes undefined FSCRYPT_POLICY_V1 in old distribution.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
In 1126e38 (fsck.f2fs: add --{no-}kernel-check to bypass kernel version diff or
not) the automatic check on a kernel version change was made optional and
disabled by default on non-Android systems. This also disabled the update of
the kernel version stored in the superblock if --kernel-check is not given.
Restore the update in case a full check is forced via -y or -f to properly
reflect the version in the superblock.
Signed-off-by: Michael Lass <bevan@bi-co.net>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch add an ioctl to get filename encryption mode.
Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
|
|
Increase debug level from 0 to 1 in migrate_block.
It seems that doesn't need to display debug message by default.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Otherwise, after shrink, kernel will report below error message
when we mount the image:
F2FS-fs (loop0): invalid crc_offset: 0
F2FS-fs (loop0): Wrong valid_user_blocks: 16404, user_block_count: 13312
F2FS-fs (loop0): Failed to get valid F2FS checkpoint
mount(2) system call failed: Structure needs cleaning.
Reported-and-tested-by: beroal <me@beroal.in.ua>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
As beroal <me@beroal.in.ua> reported: f2fs image can be corrupted
after below testcase:
1. truncate -s $((256*1024*1024)) img
2. mkfs.f2fs -f img
3. mount -t f2fs -o loop img /mnt
4. xfs_io -f /mnt/file -c "pwrite 0 2M" -c "fsync"
5. umount /mnt
6. resize.f2fs -s -t 262144 img
7. fsck.f2fs img
The root cause is we forgot to copy original sit/nat bitmap to
new checkpoint during rebuild_checkpoint(), fix it.
Reported-and-testd-by: beroal <me@beroal.in.ua>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch adds "-f" for resize.f2fs to fix broken resized f2fs.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
beroal reported a mount failure due to broken valid_user_blocks.
[ 6890.647749] F2FS-fs (loop0): Wrong valid_user_blocks: 16040048,
user_block_count: 10016768
From fsck,
segment_count_main [0x 9a95 : 39573]
-> 39573 * 2MB = 78GB as user space
overprov_segment_count [0x 4e29 : 20009]
-> 20009 * 2MB = 40GB as overprovisioned space which user can't see.
But,
[FSCK] valid_block_count matching with CP [Ok..] [0xf4c070]
-> 0xf4c070 = 16040048
valid_block_count [0x f4c070 : 16040048]
-> So, this is correct.
It turns out resize.f2fs gave very large and wrong overprovisioning space
result in shortage of user blocks. The root cause was f2fs_get_usable_segments()
didn't consider resize case which needs segment_count_main from new superblock.
Fixes: f8410857b7a8 ("f2fs-tools: zns zone-capacity support")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
I use user namespaces & debootstrap to bootstrap a system, and then
copy that into an image using sload.f2fs. However, without an option to
preserve the owner user & group of files, some files end up being owned
by the wrong user / group (0:0), which causes all kinds of other issues
This patch adds an option -P to preserve the user and group of files.
Signed-off-by: Daniel Abrecht <public@danielabrecht.ch>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
memory which malloc for uevent don't free at get_rootdev(),
it would cause memory leak, so free it before return.
Signed-off-by: Junyong Sun <sunjy516@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Similar to .db files, these are randomly updated extremely frequently.
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Old blk_zone and blk_zone_report should be compatible with v2.
And, old blk_zone_report uses reserved[4] which breaks the build.
struct blk_zone_report {
__u64 sector;
__u32 nr_zones;
__u8 reserved[4];
struct blk_zone zones[0];
};
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
If HAVE_BLK_ZONE_REP_V2 id defined, we should set v2.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch allocates zones to initial logs together, if it's on zoned device.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
When formatting conventional partition with zoned one, we should align
the starting block address of next device to the zone size.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
- mkfs.f2fs -s 4 -c second_dev first_dev
- fsck.f2fs first
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 69668488 (34017 MB)
Segment count (19128) mismatch with total segments from devices (19130) Can't find a valid F2FS superblock at 0x0
Segment count (19128) mismatch with total segments from devices (19130) Can't find a valid F2FS superblock at 0x1
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
To use Android defaults, you must use `-g android`. However, the man
page previously implied that you need only use `-g`.
Since you must specify `android`, I figured it would be appropriate
to name that field `default-options` in the man page. If there was ever
a reason to have a different set of default options, the `-g` option
could be used with a new `default-options` value, i.e. `-g example`.
Signed-off-by: John A. Leuenhagen <john@zlima12.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: John A. Leuenhagen <john@zlima12.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
If sload.f2fs encounters a file with nr_links > 1, it will mark it
as a possible hard link by remembering the original device and
inode. When sload.f2fs creates the file, it will check if it has
already created a file for the same original device and inode. If
so, it will add the original inode to the directory and increment
the number of links to it, instead of writing a new inode.
This allows sload.f2fs to accurately reproduce a directory tree that
contains hard links, such as those created by ostree. Without this
patch, directory trees containing hard links result in the content of
the files being duplicated.
This is version 2 of the patch; it has been rebased against the dev
branch and includes a fix from Jaegeuk Kim to avoid building data
contents twice on hard linked files.
Co-authored-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Jordan Webb <jordan@getseam.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Add F2FS compression support for sload
* Support file extension filter, either default-accept or default-deny
policy
* Support choice of compression algorithm, LZO (version 2) or LZ4
(default)
* Support custom log of cluster size
* Support minimum number of compressed blocks per cluster (default 1).
A cluster will not be compressed if the number can not be met.
* suuport -r (read-only) option
This releases compressed blocks to secure free space in advance. Note that,
all compressed files will have the immutable bit.
* Added manpage update
* Remove unecessary qbuf allocation (Jaegeuk, suggested by Satya)
Signed-off-by: Robin Hsu <robinhsu@google.com>
[Jaegeuk Kim: fix some bugs and refactor names]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Added new commands, compress and decompress, to support
F2FS_IOC_COMPRESS_FILE and F2FS_IOC_DECOMPRESS_FILE.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Add proprocessor defines (options) 'WITH_func',
where func = DUMP, DEFRAG, RESIZE, or SLOAD
Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
typo fix.
Signed-off-by: Victor Westerhuis <victor@westerhu.is>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
When error were found, we won't need to do any initialization but
just quit.
Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch adds a message when formatting the disk with compression.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Added new commands, get_coption and set_coption, to support
F2FS_IOC_GET_COMPRESS_OPTION and F2FS_IOC_SET_COMPRESS_OPTION.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Fix a compiling error triggered by ASSERT(exp), when exp contains '%'
(e.g. integer modular operator)
Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
'ret' should not have been used here: otherwise, it would be wrongly used
as the error code and then be returned from main().
Signed-off-by: Robin Hsu <robinhsu@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
As Eric reported:
Commit 7a22451bc2b4 ("fsck.f2fs: fix to check validation of i_xattr_nid")
This commit caused a regression where 'dump.f2fs -i <inode> <device>'
now segfaults if the inode has any extended attributes.
It's because read_all_xattrs() now calls fsck_sanity_check_nid(), which
eventually dereferences f2fs_fsck::main_area_bitmap, which is NULL.
I'm not sure what was intended here.
Here's the output from gdb:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f750fa in f2fs_test_bit (nr=1024, p=0x0) at libf2fs.c:304
304 return (mask & *addr) != 0;
(gdb) bt
ntype=TYPE_XATTR, ni=0x7fffffffdd20) at fsck.c:449
ntype=TYPE_XATTR, ni=0x7fffffffdd20) at fsck.c:495
fsck_sanity_check_nid() should only called from fsck.f2fs context, rather
than dump.f2fs, otherwise it may cause dereferencing structure fields of
fsck incorrectly.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
|
|
f2fs_io erase [block_device_path]
Signed-off-by: Ocean Chen <oceanchen@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Inodes aren't allowed to have the casefold flag set when they aren't
directories, or if the filesystem superblock doesn't have the casefold
feature enabled. Clear any such unexpected casefold flags.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
These two arguments would simply print the usage message.
Signed-off-by: John A. Leuenhagen <john@zlima12.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Currently we support fiemap command using fibmap. It's simple and
easy to use, but we cannot use this for compressed file. To support
more different types of files, we need to change this to use fiemap.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: add Android build]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
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:
https://github.com/systemd/systemd/blob/a859abf062cef1511e4879c4ee39c6036ebeaec8/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>
|
|
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>
|
|
This can be used for Android build support.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
Otherwise it fails to format in Windows.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch adds an option, mmap, when reading data.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
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>
|
|
This should avoid to read out wrong block address.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
This patch allocates some data structures that will be used for loading files
on existing image.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
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>
|
|
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>
|
|
Let's allow to show symlink path.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
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>
|
|
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>
|
|
Signed-off-by: Wuyun Zhao <zhaowuyun@wingtech.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
|
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>
|
|
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>
|
|
$ 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>
|
|
$ 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>
|