History log of /external/f2fs-tools/fsck/mount.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9e7f2526c4dff98b2a03c264208cc04cfce4cd38 01-May-2018 Jaegeuk Kim <jaegeuk@kernel.org> f2fs-tools: get kernel version via uname(2)

This patch introduces uname(2) to get kernel version.

Bug: 78358575
Change-Id: Ib50cbbc33f55cb3063a71eaf49a247f070bacf23
Merged-In: Ib50cbbc33f55cb3063a71eaf49a247f070bacf23
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
76cfef4f4050ab8c11def0f666710400853a467b 20-Apr-2018 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: fix stack overflow when reading out nat block

The size of nat_block is less then 4KB, resulting in stack overflow by dev_read.

Bug: 78349418
Change-Id: I017d83c53f618039356b5ea44e04775f6624d9d2
Merged-In: I017d83c53f618039356b5ea44e04775f6624d9d2
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
7a2c1cd470d52ce51c9f7bdbc4b6ccf59126f585 11-Jan-2018 Jaegeuk Kim <jaegeuk@google.com> mkfs.f2fs: support fsverity feature

This is aligned to f2fs which reserves fsverity feature bit.

Bug: 74604441
Bug: 67380979
Change-Id: I202b825a03d54dbe8c224e6bc9344f53eea6d671
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
/external/f2fs-tools/fsck/mount.c
ccd1c972b41b30bbed56bcc99fe5bef9dc7aee03 23-Mar-2018 Jaegeuk Kim <jaegeuk@kernel.org> FROMLIST: resize.f2fs: fix access out-of memory boundary

(am from https://sourceforge.net/p/linux-f2fs/mailman/message/36273006/)

This fixes out-of memory boundary on nat_bitmap, when resizing small to
large partition.

Bug: 76161446
Change-Id: Id3f2f6e2879833a6f0c0fa3063a0684488e597b6
Merged-In: Id3f2f6e2879833a6f0c0fa3063a0684488e597b6
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
2aef79847beee69ee427768a883b9ca9c0273274 25-Jan-2018 Chao Yu <yuchao0@huawei.com> f2fs-tools: support inode creation time

This patch supports inode_crtime feature to enable recording inode
creation time in inode layout.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
9fcc06703a906908ecac0bdbbf485d668e5b58d2 22-Jan-2018 Yunlei He <heyunlei@huawei.com> fsck.f2fs: use mem nat info directly

Use mem nat info directly for we built in fsck init.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
d6f81a776904bad9379a5d852dda6992db9ad217 20-Jan-2018 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: show missing checkpoint flags

This patch shows some missing checkpoint flags.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
5d87f6ccad8b381d72f36854ddf0c6732066634b 11-Jan-2018 Sheng Yong <shengyong1@huawei.com> dump.f2fs: do not write nat bits when dumping info

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
0f91068a5dc5656d669597bde030d91a30b1284f 04-Jan-2018 Yunlei He <heyunlei@huawei.com> dump.f2fs: Test blkaddr is valid or not in option '-b'

Test blkaddr is valid or not in option '-b'

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
568e614252ffed70fce9d87cc4122fe4ca855bc5 29-Dec-2017 Yunlei He <heyunlei@huawei.com> fsck.f2fs: Remove unused ckpt_valid_map info

Remove unused ckpt_valid_map info.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
1a3cfda4fa139c6e635aae5fa1c01c6c8cbd101f 30-Nov-2017 Jaegeuk Kim <jaegeuk@kernel.org> f2fs-tools: enable sparse_file opeartions

This adds reading data from sparse_file.

Change-Id: Icd8ec8f401a5ba87d6d9a26dd07062cc003de1e4
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
6e21c124dad19bf9213841161a14983d6d31e6d8 30-Nov-2017 Jaegeuk Kim <jaegeuk@kernel.org> sload.f2fs: update build for android

This patch updates sload.f2fs for android build.

- do fsck() after sload() to update quota information.
- return success, if there's no source directory

-C fs_config

-f source directory [path of the source directory]

-p product out directory
: path on fs_config file for uid/gid/mode

-s file_contexts
: selabel file

-t mount point [prefix of target fs path, default:/]
: path stored in selabel/fs_config files

-T timestamp

Change-Id: Ibb600411dac6081fc63c978cf3086092b89fe9f3
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
bf3207b41978d4329e106cb12cbd501e4643eaf9 24-Nov-2017 Chao Yu <yuchao0@huawei.com> libf2fs: propagate error from f2fs_{finalize,fsync}_device

tests/generic/405 of fstest suit expects that mkfs will return error
when it hits EIO, so let's propagate error from
f2fs_{finalize,fsync}_device, then mkfs can be aware of fsync error.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: initialize ret to zero]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
71b8602562d2cd660f2ea75f3ef533adcd7b8548 16-Nov-2017 Chao Yu <yuchao0@huawei.com> f2fs-tools: adjust feature name

This patch slightly changes showed feature name.

Before:
Info: superblock features = f9 : encrypt extra attribute project quota inode checksum flexible inline xattr quota ino

After:
Info: superblock features = f9 : encrypt extra_attr project_quota inode_checksum flexible_inline_xattr quota_ino

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
6a82c481f185a18fa4d51da7dc932eacc45ca92f 16-Nov-2017 Chao Yu <yuchao0@huawei.com> dump.f2fs: show extra attr only when feature is enabled

If we don't turn on the feature, don't show related info in dumped data.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
106720780ab71c8d17a4f92379e1f9cb6cd0417d 14-Nov-2017 Jaegeuk Kim <jaegeuk@kernel.org> f2fs-tools: build binaries in Mac

This patch modifies f2fs-tools to be built in mac.

Change-Id: Ib341e2255b86cb07a7809a83237d9af616fc8777
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
e099777e7ef054da19aaa98dd1d9fe205891dab9 02-Nov-2017 Sheng Yong <shengyong1@huawei.com> dump/fsck: introduce print_xattr_entry

This patch exports read_all_xattrs to allow dump/fsck to get all xattrs,
and introduces print_xattr_entry which tries to parse an xattr entry
accroding to its xattr index.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
[Jaegeuk Kim: fix configure.ac]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
e878cf63f6030b1b101f4eb6ff46a14a4b8ea731 02-Nov-2017 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: format output message of FIX_MSG

This patch removes an extra '\n' at the end of the string in FIX_MSG.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
4649b0400105dd831e5e2fd4658d36d00f7cd3e2 02-Nov-2017 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: do not fix corrupted nat entries in build_nat_area_bitmap

Fixing corrupted data depends on c.fix_on. If it's not set, we should not
force fixing corrupted data. So if nat entries are found invalid when
building nat_area_bitmap, we should just set c.bug_on, and fix it later.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
3c828a4ef8d7efbc226ac3643b2d7746b121a78e 02-Nov-2017 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: do not set fix_on directly

Do not set fix_on if it is allowed by user.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
c1dee2c69c015029017c97805c5b7f179cfc9236 31-Oct-2017 Hyojun Kim <hyojun@google.com> fsck.f2fs: support quota

+ modify Android.mk for Android

This patch let fsck to check and fix quota file contents.

Signed-off-by: Hyojun Kim <hyojun@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
/external/f2fs-tools/fsck/mount.c
97168b7ad427302967c9b95394f417aa0c39fffa 04-Sep-2017 Chao Yu <yuchao0@huawei.com> f2fs-tools: support flexible inline xattr size

This patch makes mkfs to support flexible inline xattr feature, also
this enables fsck to recognize new disk-layout of inode which be of
flexible inline xattr size.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
af3689f18aee728d6f1e0672da2b26c3cf93975d 17-Oct-2017 Yunlei He <heyunlei@huawei.com> fsck: introduce generic function f2fs_fsync_device

We use f2fs_finalize_device to fsync previous data in
checkpoint area before write last CP pack, in order to avoid
cp corruption in sudden-power-off case. But this function will
close the device, so this patch introduce a function to call
fsync() only.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
a288a200cdb317265c74184be31849e6942ab08a 16-Jul-2017 Chao Yu <yuchao0@huawei.com> f2fs-tools: release 1.9.0

This release includes:
- sparse support
- inode checksum support
- nat_bits option
- encryption management
- noheap allocation by default
- add CP_TRIMMED_FLAG

f2fs-tools: spread struct f2fs_dentry_ptr for inline path
f2fs-tools: add atomic_write feature flag
f2fs-tools: enhance on-disk inode structure scalability
f2fs-tools: support project quota
f2fs-tools: fix printing block adresses
f2fs-tools: support inode checksum
mkfs.f2fs: fix missing cpu_to_le64 for checkpoint version
fsck.f2fs: write back last cp block in the end
mkfs.f2fs: fix wrong curseg check
f2fs-tools: add cscope files to .gitignore
f2fs-tools: fix is_set_ckpt_flags for correct bool value
f2fs-tools: move_curseg_info only if check_curseg_offset fails

Change-Id: I28f6287977fe9bc1082da18d327f0a70ea1a9623
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
3dc158fe96459aee96966e74546261d5fc27bd0b 26-Jun-2017 Jaegeuk Kim <jaegeuk@google.com> f2fs-tools: merge -next changes am: ddd7ebd6e6 am: 7d8bbc5e03
am: 03ad1f2a02

Change-Id: I4c2e21830563cef7b3f833e0925abea9122b9fbe
ddd7ebd6e6a7c2f6b499cab08c1fac230edb920b 04-Feb-2017 Jaegeuk Kim <jaegeuk@google.com> f2fs-tools: merge -next changes

Changes include:
mkfs.f2fs: drop initial spaces for feature string
f2fs-tools: avoid build warnings
(origin/dev, dev) mkfs.f2fs: avoid wrong discard of dnode
f2fs-tools: fix the wrong message when errno is EBUSY
f2fs-tools: support to set and recognize CP_TRIMMED_FLAG
fsck.f2fs: sanity check segno and blk_off when building curseg array
fsck.f2fs: sanity check cp_payload before reading checkpoint
fsck.f2fs: sanity check blk_off for summary block entries
mkfs.f2fs: fix wrong segment assignment
f2fs-tools: sanity check segment count
fsck.f2fs: fix cur_valid_map buffer overflow
Fix mkfs out of tree builds
mkfs.f2fs: use noheap by default
libf2fs: avoid overwrite the c.start_sector by non-root device
...

Change-Id: I27adc30ff4439e5b3f7a290d81a3a783bf916d4a
Merged-In: I27adc30ff4439e5b3f7a290d81a3a783bf916d4a
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
8be4c2d04755d8d7b3c4dd9b15b1b1345c53d14a 28-Apr-2017 Jin Qian <jinqian@google.com> fsck.f2fs: sanity check segno and blk_off when building curseg array

segno and blk_off were read from input image without sanity check. This
could lead to buffer overflow when accessing internal arrays like SIT
sentries and seg_entry cur_valid_map.

Bug: 36266023

Change-Id: I09a54c61707ec40607bb8314276875ce7ab4c22a
Signed-off-by: Jin Qian <jinqian@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
2010f975eefe4bb74623a0699527bea4ba726c06 27-Apr-2017 Jin Qian <jinqian@google.com> fsck.f2fs: sanity check cp_payload before reading checkpoint

cp_payload is not sanity checked from input image. A invalid size
can cause buffer overflow when reading checkpoint blks into memory.

Bug: 36493182

Change-Id: I3ee62cbd6817e267de607454dd7223a4f0fd2c4d
Signed-off-by: Jin Qian <jinqian@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
2c3f0a64f8feebc5292eaa98de73a8c30aebf686 27-Apr-2017 Jin Qian <jinqian@google.com> fsck.f2fs: sanity check blk_off for summary block entries

crafted malicious f2fs partition can fill an out of bound blk_off,
which cause overflow when accessing summary block entries.

Bug: 36394556

Change-Id: Icf0dfa7803a377c140b7d30cd7037c6058a4f8ea
Signed-off-by: Jin Qian <jinqian@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
1a59456653beccf08281281c32abfa4fff785f73 26-Apr-2017 Jin Qian <jinqian@google.com> f2fs-tools: sanity check segment count

make sure segment count in super block doesn't exceed F2FS_MAX_SEGMENT.

Bug: 36392513
Bug: 36815012

Change-Id: I0f699f58fb6bab27008a7ab956a87fe241bb0169
Signed-off-by: Jin Qian <jinqian@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
9deb6fd9f2104eac0748f42c1135e6dff175e9b5 19-Jan-2017 Sheng Yong <shengyong1@huawei.com> f2fs-tools: correct endianness

It is reported that fsck.f2fs behaves abnormally when running on MIPS32
rel 2 big endian cpu, since incorrect endianness. So let's correct all
endianess issues of f2fs-tools.

Reported-by: <k@vodka.home.kg>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
b88767e606394fb6aec408abb98024dfb81ef946 23-Nov-2016 Liu Xue <liuxueliu.liu@huawei.com> fsck.f2fs: flush curseg sit entries

Flush curseg sit entries, since type of sit entries may
be changed after move_curseg_info.

Signed-off-by: Xue Liu <liuxueliu.liu@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
de7e07e011004a0264e27d7134ee32cbcd9695ec 02-Nov-2016 Jaegeuk Kim <jaegeuk@kernel.org> f2fs-tools: support multiple devices

This patch adds an option to specify multiple devices for an f2fs instance.

Up to 7 devices in addition to the default device can be added.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
ea1bd1ce3152f86c5b82424654689911c406835d 08-Nov-2016 Junling Zheng <zhengjunling@huawei.com> fsck.f2fs: refactor build_nat_area_bitmap to speed up fsck

Refactor build_nat_area_bitmap, move out lookup_nat_in_journal from the
dual loops. Instead of looking up all nids in journals, we traverse nat
journals, whose entries are used to replace the NAT entries with the
corresponding nid to reduce the time build_nat_area_bitmap costs.

For "fsck -p 1", it reduces over half of the time.

Empty Fragmented Entirely
32G(ms):
original 625.8 727.3
improved 226.3 298.2
64G(ms):
original 1159 1637.7
improved 515.8 676.7

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
890e9b325d4b94ea49499dea1712eb29b8dca707 04-Nov-2016 Yunlei He <heyunlei@huawei.com> fsck.f2fs: add a judgment after calloc

This patch add a judgment after calloc avoid memory alloc
failure

Signed-off-by: Yunlei He <heyunlei@huawei.com>
[Jaegeuk Kim: remove unneeded memset to avoid build warning]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
9e341fa6b3cbfd13fbb6af7b0b81943f0ef87b41 04-Nov-2016 Yunlei He <heyunlei@huawei.com> fsck.f2fs: no need to write a new cp if nothing to flush

This patch avoid to write a new cp if no journal info

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
bfa074377120f886b25b4fabf05978f80bb97e46 03-Nov-2016 Jaegeuk Kim <jaegeuk@kernel.org> f2fs-tools: fix end block addres when finding free block

This patch fixes wrong end_blkaddr condition for free block allocation.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
893acfc2e430e2a511de12ae57c3c32a62a7dfe3 02-Nov-2016 Liu Xue <liuxueliu.liu@huawei.com> fsck.f2fs: add SSR-based allocation when free segment not enough

Add SSR-based allocation when free segment reach the limit of
reserved segments.

Signed-off-by: Xue Liu <liuxueliu.liu@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
112bf05cb881c098e6514e6554c171a096470b0e 02-Nov-2016 Liu Xue <liuxueliu.liu@huawei.com> fsck.f2fs: rewrite entries info in segment manager

The entries info in segment manager may be not correct, since
corrupted blocks may already cleaned. So rewrite se info with
main area bitmap.

Signed-off-by: Xue Liu <liuxueliu.liu@huawei.com>
[Jaegeuk Kim: remove obsolte variable in f2fs_fsck]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
4b1ecd77a182c731c29cd31986508fdbe53829ed 28-Oct-2016 Damien Le Moal <damien.lemoal@wdc.com> fsck.f2fs: check BLKZONED feature on mount

The BLKZONED feature is mandatory for host-managed zoned block
devices. So check that it is set.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
81c62e2537caaacfd0937b93535006edda73e1b5 28-Oct-2016 Damien Le Moal <damien.lemoal@wdc.com> f2fs-tools: use zoned block device terminology

SMR stands for "Shingled Magnetic Recording" which makes sense
only for hard disk drives (spinning rust). The ZBC/ZAC standards
enable management of SMR disks, but solid state drives may also
support those standards. So replace "SMR" with "zoned block device"
to avoid a HDD centric terminology.

In particular, rename the HMSMR feature to BLKZONED.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
6471969f785854a51d59fe9e5ee926b863cd28f9 24-Oct-2016 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: do not check the first seg in a sec in find_next_free_block

The first segment is already checked, so there is no need to check it
again if we want to make sure the whole section is freed.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
c4c65265da347bf98af6f080abf6d7081df09ea1 24-Oct-2016 Sheng Yong <shengyong1@huawei.com> dump/fsck: convert encrypted file name

If fscrypt is enabled, we need to convert the encrypted file name before
printing it. So let's export convert_encrypted_name for other functions,
and make it returns the length of converted string.
This patch also changes the parameter of file_is_encrypt to f2fs_inode.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
390fe587b1b843270bbf7f1e35ac08c8a48d03a1 14-Oct-2016 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: support restore lost files into ./lost_found/

This patch adds to support restoring lost files into ./lost_found/.

For example,

# fsck.f2fs /dev/sdXX

...
NID[0x87d7] is unreachable
NID[0x87d8] is unreachable
NID[0x87d9] is unreachable
[FSCK] Unreachable nat entries [Fail] [0x4988]
[FSCK] SIT valid block bitmap checking [Fail]
[FSCK] Hard link checking for regular file [Ok..] [0x0]
[FSCK] valid_block_count matching with CP [Fail] [0x2]
[FSCK] valid_node_count matcing with CP (de lookup) [Fail] [0x1]
[FSCK] valid_node_count matcing with CP (nat lookup) [Ok..] [0x4989]
[FSCK] valid_inode_count matched with CP [Fail] [0x1]
[FSCK] free segment_count matched with CP [Ok..] [0x1f7]
[FSCK] next block offset is free [Ok..]
[FSCK] fixing SIT types
[FSCK] other corrupted bugs [Fail]

Do you want to restore lost files into ./lost_found/? [Y/N] y

Then, you can restore unreachable files from ./lost_found/ in its best effort.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
9a708f0fe4850232bcb839467d6ef7908e7e3edb 30-Sep-2016 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: allocate buffer after condition check

This patch makes buffer allocation be done after condition check.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
3d19ea91bc8923a59155c75b2e4fee5074e1434c 29-Sep-2016 Junling Zheng <zhengjunling@huawei.com> fsck.f2fs: fix a typo in check_sector_size

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
276571e86634c0b6d8626dfaf965c4a27de4f3b9 29-Sep-2016 Junling Zheng <zhengjunling@huawei.com> fsck.f2fs: fix incorrect ERR_MSG in f2fs_do_mount

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
d256214da8e041940bd97c37e7629775676641f6 29-Sep-2016 Junling Zheng <zhengjunling@huawei.com> fsck.f2fs: free cp_page_1 in validate_checkpoint

Free cp_page_1 in validate_checkpoint to avoid memory leak.

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
f1ee35104dbc6279e52c9cf389acaeb12ac0c126 23-Sep-2016 Yunlei He <heyunlei@huawei.com> fsck: porting avoid unneeded loop in build_sit_entries to fsck

This patch porting avoid unneeded loop in build_sit_entries to fsck

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
3ffc5a8f3ea0a70e247d1b1b222ad27f20716bdd 17-Sep-2016 Jaegeuk Kim <jaegeuk@kernel.org> f2fs-tools: use shorter config variable name

This patch has no functional change.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
9884ad4e793c457acf6516a0b568a11ca9fdc7df 15-Jul-2016 Xue Liu <liuxueliu.liu@huawei.com> fsck.f2fs: clean up duplicated code

Call current_nat_addr() to calculate nat block address.

Signed-off-by: Xue Liu <liuxueliu.liu@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
49503225c01eaf01d50255fd75b4534ba802ce0c 15-Jul-2016 Sheng Yong <shengyong1@huawei.com> f2fs-tools: update the format of output message

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
89d5d52da864f1dbff0314a253e09e9a89ab1071 15-Jul-2016 Sheng Yong <shengyong1@huawei.com> f2fs.fsck: fix endianess

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
11adb13a79b141d99bb50b0f225332431939190c 15-Jul-2016 Sheng Yong <shengyong1@huawei.com> dump.f2fs: show inode->i_dir_level

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
70a8fc3df7b72730fd2d40394892688292e8f78e 13-Jun-2016 Jaegeuk Kim <jaegeuk@kernel.org> mkfs/fsck: add host-managed smr feature

This feature flag will be used by f2fs to detect HMSMR device.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
22aa244ad7a8839dd921995a3c12ff0a88f4dc7d 18-May-2016 Yunlei He <heyunlei@huawei.com> fsck.f2fs: check sector size if formatted from a regular file

This patch check sector size if formatted from a regular file,
write the sector info to superblock from device info.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
43448f9bfda5f2abcf36e3ce94e17752b0cbe421 26-Apr-2016 Junling Zheng <zhengjunling@huawei.com> fsck.f2fs: remove duplicated codes in sanity_check_raw_super

Remove duplicated codes in sanity_check_raw_super().

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
603f8f9d3628e8b81fea301e5f543a9f0b0d902d 10-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> sload.f2fs: support loading files into partition directly

This patch implements loading files into the existing partition.
For example,
# sload.f2fs -f ./ /dev/sdb1

Then, all the directories and files will be loaded into /dev/sdb1.
By default, newly files should have inline_data and inline_xattr, if possible.

Signed-off-by: Hou Pengyang <houpengyang@huawei.com>
Signed-off-by: Liu Shuoran <liushuoran@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
99ffb3da59ad1e8ff4aa1ebf5243109a891b7401 23-Mar-2016 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: check sanity of superblock and fix any misalignment

This patch detects any corrupted superblock and fix misalignment when it finds,
which is synced with the f2fs kernel module.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
0301f1699136730b4509d862470f9d3b50e412ac 23-Mar-2016 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: nullify the freed ckpt pointer

Otherwise, we get a double free error by:

In fsck/main.c,

545 out_err:
546 if (sbi->ckpt)
547 free(sbi->ckpt);

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
ce46aed2598b3607c50a292698aa181595ba96a1 14-Mar-2016 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: check ino in nat entry and node footer

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
31f461cd896062c9bd0a7bc67f367aa61452505c 14-Mar-2016 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: cache all nat entries and check each of them

All nat entries are cached during building nat_area_bitmap, so that, in
fsck_chk_meta, we can get and check blk_addr and ino directly, to see if
they are in the valid range. Also, blk_addr is checked to see if the block
is valid in sit's valid maps.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
bc28669d6b8bbe873b91ca67f6d0fac354d21a13 14-Mar-2016 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: count the number of inodes during building nat_area_bitmap

The nid and ino of an inode are the same. So during building
nat_area_bitmap, we can know which nat entry represents an
inode, thus, we can count the number of inodes.

Then in fsck_chk_meta, the amount of inodes can be compared
with that recorded in CP.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
6e225697bda9459ffb62d0bcccc545193cc9ecdf 14-Mar-2016 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: introduce -p option to check meta

This patch introduces a new option '-p' to do more checks on NAT/SIT areas.
'-p' has 2 levels: level 1 has the same sematics as '-a'; level 2 checks
NAT/SIT counters to see if they matches the status in SB and CP.

A new function, fsck_chk_meta, is called by '-p 1' to implement these
comparsion. If errors are detected, fix_on is set, which means fsck will
do a 'fsck -f' immediately.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
f102ca4c3f421e04397ab2fab443ca43b86da385 11-Mar-2016 Chao Yu <chao2.yu@samsung.com> f2fs-tools: rebase struct f2fs_summary_block with upstream

Struct f2fs_summary_block has been changed in upstream commits:
- commit 8f1dbbbbdfe9 ("f2fs: introduce lifetime write IO statistics")
- commit dfc08a12e49a ("f2fs: introduce f2fs_journal struct to wrap journal info")

This patch does the sync work for f2fs_summary_block structure between
f2fs-utils and f2fs kernel module.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
9b09631c8f82b4687c179a6a4b86a4e6c5b4df75 03-Mar-2016 Junling Zheng <zhengjunling@huawei.com> fsck.f2fs: fix incorrect block_addr of node/meta

Fix incorrect block_addr of node or meta inode into 0x1 during
build_nat_area_bitmap().

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Liu Xue <liuxueliu.liu@huawei.com>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
bc6f686893f2b14a0d182fdb3b2165ac9720f0a2 27-Feb-2016 Junling Zheng <zhengjunling@huawei.com> fsck.f2fs: calculate the total size correctly

Correctly calculate the total FS size in init_sb_info(), for sector
size may not be 512 bytes.

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
c00fe85bc7166c1c34420cf621e749c3d3e42f78 23-Feb-2016 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: fix corrupted nat entry [0]

The first nat entry must be null. If it is corrupted, we set its bit in
nat_area_bitmap, without increasing valid_nat_entry_cnt, fsck_verify will
nullify it at last.

Reported-by: Cheng Yinchao <chengyinchao@huawei.com>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
e92fd4261894903fb8d6fa8de6a38c5eaf1a913c 21-Jan-2016 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: nullify raw_super pointer

Otherwise it will cause double free.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
231fc70f6e9d57658393911c705346b061f23513 15-Jan-2016 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: assign checkpoint pointer correctly

This patch fixes a bug that cp pointer is not assigned correctly.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
b9eb1dc383302676f7e188baf7bfa0c9e8fa4600 14-Jan-2016 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: swap checkpoint crc to CPU endian

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
25b2e75312231659cd8460064e1892351171b00c 13-Jan-2016 Jaegeuk Kim <jaegeuk@kernel.org> f2fs-tools: avoid failure and warnings for android build

This patch fixes to resolve build failure and warnings when compiling it
under AOSP.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
2d3ea141ccf280dbf8b04a43c61d388cd147a568 28-Dec-2015 Sheng Yong <shengyong1@huawei.com> fsck.f2fs: fix double free invalid checkpoint

The invalid checkpoin is freed in validate_checkpoint().

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
a828ebb234b7badba730ff3a08304834ca57b7dc 20-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: fix losing journal entries

If fsck.f2fs reports a bug, move_curseg_info tries to change the current
segment info.
When it changes the new summary block, it overwrites the existing journal
entries.
This patch fixes it not to overwrite journal entry space.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
767a93ea8bf1f66cf119830d2a42775395675cd6 19-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> defrag.f2fs: fix missing SSA updates

Previously SSA is updated if it is not included in current segment info.
But, defrag.f2fs doesn't handle current segment info during the process, and
instead lastly update the whole current segment info at a time.
So, we need to update summary entries all the time.
Otherwise, we can lose the SSA entry.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
f66104cf3a29b9e5645ba77090fac0521cf73318 18-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> defrag.f2fs: enhance allocation speed

This patch improves the allocation speed.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
d6147940b92a409667cbff3b047ce7f384b8d6b5 17-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> defrag.f2fs: return error if there is no space

This patch checks whether there is a space or not to allocate new blocks.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
17acba6d3da4efd60142b513b2017bddf67d49bb 17-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> defrag.f2fs: eliminate unexpected journal entries

When moving data or node blocks, it changes current segment information
dynamtically. Meanwhile, its journal entry space is recovered by old
stale data.
This patch makes sure that its journal space is zeroed out.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
552d6a8f4bf524558218aea42f5faf230b7b6128 16-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> defrag.f2fs: fix not to allocate current segment

This patch fixes allocating wrong segment which has zero data but is registered
as a current segment.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
9e5c021b679ebd54c719d68e8b5e6b5614fbf127 14-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> mkfs.f2fs: fix storing volume label correctly in utf16

This patch fixes to store volume label as utf16 correctly.

Many conversion codes are copied from exfat-tools.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
2c1ebe237acb9b1e8093f9aecd0c92b53583877b 23-Oct-2015 Jaegeuk Kim <jaegeuk@kernel.org> defrag.f2fs: introduce defragmentation tool

This tool tries to move the valid blocks ranging from blkaddr to blkaddr + len
to targeted blkaddr with a direction like expand or shrink.

The option includes:
-d debug level [default:0]
-s start block address [default: main_blkaddr]
-l length [default:512 (2MB)]
-t target block address [default: main_blkaddr + 2MB]
-i set direction as shrink [default: expand]

For example,
# defrag.f2fs -s 0x100 -l 0x10 -t 0x4000 /dev/sdb1

This will move data blocks between 0x100 and 0x110 to the right side of
0x4000 space.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
003b102d8a26e82547ecfd89dc36066616b4ffaa 10-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: LFS alloc_type must have free segment after blkoff

This patch checks alloc_type of current segment type.
If it is LFS, the last of segment should have no valid block.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
1a35b5e29df043678b7ce485aee5fb2607d514c8 09-Dec-2015 Jaegeuk Kim <jaegeuk@kernel.org> f2fs-tools: export print_raw_sb_info

This patch exports print_raw_sb_info().

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
0e0b9f284477dc8505a69a0f5073d4385f56a7d6 22-Nov-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: use get_{sb|cp} and set_{sb|cp} macros

We can use get_cp, set_cp, get_sb, and set_sb in fsck.f2fs.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
ee48fd2ced9bee686a51062d9d53f329a396a4e3 22-Nov-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: declare static function

This avoids the following warning.

mount.c:783:27: warning: SM_I is static but used in inline function
check_seg_range which is not static.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
641d98f26d03ad4ff52ca8a445b60df206f0a974 29-Apr-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: avoid build warning

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
4476615d2680d67128a405e6e79c61ceeb0b2ccb 24-Apr-2015 Jaegeuk Kim <jaegeuk@kernel.org> dump.f2fs: show i_advise field in inode

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
f6eef57a692a474462350f5a6254b692b1036aa7 24-Apr-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: show superblock features and encryption info

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
65950fc736713f259a56bb670492588c6c214523 10-Apr-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: show ckeckpoint version info

This patch shows the valid checkpoint version number.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
fce2ff183ea873c6c311e796bc2a0a49fe1b81fd 27-Mar-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: return summary block pointer and types

This patch adds to return summry_block pointer to callers, which will be used
when fixing them.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
fea6162a6db9af527648262d9fbb0335a0cc5460 21-Mar-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: show total sectors consumed by filesystem

This patch shows the information about the number of total sectors composing
filesystem.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
7ba9eec293b70f7e7204512a59e58205bbb1cecc 21-Mar-2015 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: show cp_state for fsck.f2fs

This patch adds to show cp_state during fsck.f2fs.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
37580f1c5b2d7d0f815105685b68c329002d459b 05-Feb-2015 Chao Yu <chao2.yu@samsung.com> fsck.f2fs: support large sector size

Since f2fs support large sector size in commit 55cf9cb63f0e "f2fs: support large
sector size", block device with sector size of 512/1024/2048/4096 bytes can be
supported.

But fsck.f2fs still use default F2FS_LOG_SECTOR_SIZE/F2FS_LOG_SECTORS_PER_BLOCK to
verify related data in f2fs image, it's wrong, let's fix this issue in this patch.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
9c6617d06dbdf8266838569b8169b0f9471704f4 13-Dec-2014 Jaegeuk Kim <jaegeuk@kernel.org> dump.f2fs: dump owner of data given block address

This patch introduces a feature to dump owner information of given block
address.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
8f521d91724f21f96ddab06f2771d3150139298e 13-Nov-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: avoid false alarm on SIT type fix

This patch removed a false alarm when detecting any inconsistency in SIT types.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
762eedf87fe28f3c2c340a3b41438cbeee7e0c96 07-Nov-2014 Jaegeuk Kim <jaegeuk@kernel.org> mkfs.f2fs: give a kernel version for initial format

This is to identify when the format was done.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
6fa2547e04d194141ef760564d3119b7c112aac8 07-Nov-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: trigger fsck.f2fs when new change was made

This patch remains user specified triggering information in superblock.
Then, if the information was changed, fsck.f2fs is triggered.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
232ce7671ea505dfbb9f0ca7be74516ca9687a7b 06-Nov-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: fix SIT entry types

Sometimes, SIT entry type is broken, so we need to rebuild it.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
5007756839040c8cc27690e7f84587d3e37f1ce4 19-Oct-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: show inline status of inode

This patch adds to show inline status of each inode.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
1dd3bc0a17622c564fca414ea1efd841ec51cad6 09-Oct-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: fix superblock offset

The second offset should be F2FS_BLKSIZE + F2FS_SUPER_OFFSET.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
cfeb015e887db6edbd13ad41597d82f1e565fc33 04-Sep-2014 Jaegeuk Kim <jaegeuk@kernel.org> f2fs: rearrange options to remove redundant check

This patch summarizes the usage of options.

-a : auto_fix, fix corruption, only if f2fs reported some potential errors
-f : force, fix corruption entire partition
None : prompt, if fsck.f2fs detets any corruption

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
7eb6c5a03b78d8673030e89ce15345d69d5e5777 03-Sep-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: add auto_fix feature

This patch adds an auto_fix feature which fixes inconsistency of f2fs images.

E.g.,

With this option, -a, fsck.f2fs tries to fix inconsistency only if its valid
checkpoint has CP_FSCK_FLAG, written by previous bug_on cases.

So, normally it does fix nothing, so that there is no performance regression.
But, if a sort of corruption was reported by the f2fs module, this tries to
fix potential corrupted partition.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
a6b2870ddb760ab2e2f662db0c09f220d02c6d9e 29-Aug-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: check next block is free or not

If block allocation is made to the next block offset, we should drop that
block.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
b700e313b4ad390fce7f610c51d0bb2dc52661bb 28-Aug-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: fix checkpoint

- fix nat entries
- fix sit entries
- fix checkpoint

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
1dc1edfbcbaa20f876f7958e2c7423ebef48a9da 28-Aug-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: handle correctly segment summary entries

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
48863d422ee4c9f01f0dfc9cff12240f5e3883e2 28-Aug-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: give a chance to recover sit entries

This patch skips initial verfication on SIT entries, which checks the number of
valid blocks from its bitmap.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
1ce70c67e3a801158adde211f0004d3ea4653067 28-Aug-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: cleanup mount.c

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
5cd7001f5dfaf1c7f275826c44dcf203d49f4cce 28-Aug-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: handle error cases

Do sanity check first and then update metadata.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
2701c94ab00c350a41ab874a52846b0a93bad9e1 28-Aug-2014 Jaegeuk Kim <jaegeuk@kernel.org> fsck.f2fs: remove return value of get_node_info

We don't need to get the return value.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
58edb106a8b47d2ed693ab41f63b314dc2882ecd 30-Jun-2014 Mark Salyzyn <salyzyn@google.com> f2fs-tools: 64-bit compile issue

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Change-Id: I9398b877571d3dabbcb29c87a67d59672ea7fbaa
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
4ea4f1db27c0d0d3e40f561191b4ceeecb80ab1a 12-May-2014 Changman Lee <cm224.lee@samsung.com> fsck.f2fs: large volume support

This patch support large volume over about 3TB.

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
[Jaegeuk Kim: add missing cp_payload in f2fs_super_block]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
/external/f2fs-tools/fsck/mount.c
a68ee58a5d1485be637bcc4e4fbddc5da727fc62 14-May-2014 JP Abgrall <jpa@google.com> Cleanup various build warnings (signed vs unsigned, unused vars,...)

* removed unused includes.
* removed unused parameters.
* Fixed a bunch of warnings around:
int i;
if (i < some_uint) ...
and
u32 x;
...
if (x < 0) return error;
* Protect BLKDISCARD usage if it is not available.

Change-Id: Iede035b1beb2df01c961589a69aff47a5258ecd2
Signed-off-by: JP Abgrall <jpa@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
/external/f2fs-tools/fsck/mount.c
858c4039c85f7c00c57925902985701b1e083555 05-Feb-2014 Jaegeuk Kim <jaegeuk.kim@samsung.com> mkfs, fsck: change the results for readability

This patch cleans up several printing formats.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
/external/f2fs-tools/fsck/mount.c
cd1e4704d0cbf1cbb49b3f33c576566b4b1e296e 20-Aug-2013 Jaegeuk Kim <jaegeuk.kim@samsung.com> fsck, lib: support inline xattr

This patch adjusts the modification to handle inline xattrs.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
/external/f2fs-tools/fsck/mount.c
223fdf3e00a56cb32fb8c69dc4523ee53ff7731a 30-Jul-2013 Changman Lee <cm224.lee@samsung.com> f2fs-tools: cleanup debug statement

The debug message is too verbose therefore decrease message.

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
/external/f2fs-tools/fsck/mount.c
8843554c8c43e713e2ce4e36ac3c06f9eca94b09 18-Jul-2013 Changman Lee <cm224.lee@samsung.com> dump: dump inode information from blkaddr

This patch is to dump inode which blkaddr belongs in.
Usage:
dump.f2fs /dev/sdx -b blk_addr (in 4KB)

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
/external/f2fs-tools/fsck/mount.c
7f35b548d4b0e3c8577ad7a09433e589a0ab3f2a 04-Jul-2013 Changman Lee <cm224.lee@samsung.com> f2fs-tools: add fsck.f2fs and dump.f2fs

fsck.f2fs checks file system consistency, but does not repair a broken
file system yet.
dump.f2fs shows the information of a specific inode and makes dump file
of SSA and SIT.
f2fs checks file system consistency as follows:
o When data about used area and its metadata are identical,
f2fs is considered consistent. To verify such consistency, we use
three bitmaps: nat_area_bitmap, sit_area_bitmap, and main_area_bitmap.
First, each bit in nat_area_bitmap corresponds to a nid in NAT.
Second, each bit in sit_area_bitmap corresponds to a valid block in a
segment. This bitmap is same to the total valid_map of f2fs_sit_entries
in SIT.
Last, each bit in main_area_bitmap corresponds to a block in main area
except meta area.
After a consistency check of each block, we set or clear the
corresponding bit of each bitmap.
From the root node, we start consistency check. The verified
information varies according to block type.
1. NODE
- Read information of node block from NAT
- Check if block address is allocated using node info.
- Check if the type of f2fs_summary related to nid in SSA is NODE.
- Update the corresponding bit in nat_area_bitmap.
- Update the corresponding bit in sit_area_bitmap.
- Set the corresponding bit in main_area_bitmap to 1.
- Then, read node block. According to its attribute, explore
inode/direct node/indirect node/double indirect node
recursively.
- If it is an inode block, we also check its xattr and hard link.
2. DATA
- Check if the type of f2fs_summary related to nid in SSA is DATA.
- Set the corresponding bits of sit_area_bitmap and
main_area_bitmap to visited
- If it is a dentry block, traverse each dentries that may be
regular
file or directory. At this time, it will check inode block again.
Finally, we verify whether
- every nat_area_bitmap is visited
- any unreachable hard link exists
- values of sit_area_bitmap and main_area_bitmap are identical
- total_valid_block_count/node_count/inode_count are correct

Usage:
o fsck.f2fs
# fsck.f2fs /dev/sdx
options:
-d debug level [default:0]
o dump.f2fs
# dump.f2fs -i [ino] /dev/sdx
# dump.f2fs -s 0~-1 /dev/sdx (SIT dump)
# dump.f2fs -a 0~-1 /dev/sdx (SSA dump)
options:
-d debug level [default:0]
-i inode no (hex)
-s [SIT dump segno from #1~#2 (decimal), for all 0~-1]
-a [SSA dump segno from #1~#2 (decimal), for all 0~-1]

Note: To use dump.f2fs, please run make install or ln -s fsck.f2fs
dump.f2fs

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Byoung Geun Kim <bgbg.kim@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
/external/f2fs-tools/fsck/mount.c