aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mkfs.f2fs: trim using BLKSECDISCARDstable/cm-12.1-YOG4PKeith Mok2015-09-281-10/+13
| | | | | | | | | | | Currently, during format volume, it does nothing on trim_device function. Leaving user data unwipe before format. User data is recoverable even with master clear. This patch fix it. SAMBAR-729 Change-Id: Ie9197554aac9118747f4c95d189230283a276766 (cherry picked from commit 6b39b93d83ab4ccb1913ecbc7a5a3e16766a011f) (cherry picked from commit 8aa4c4b9737e7e31a2648c3795a080f1772c8fdf)
* f2fs-tools: release 1.4.1Jaegeuk Kim2015-05-041-2/+2
| | | | | | This version includes mostly bug fixes. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fstat: fix option parsingMichael Lass2015-05-041-1/+1
| | | | | | | | On systems using unsigned char as default (char)EOF != EOF. Use int to store returned value of getopt to make it work on all platforms. Signed-off-by: Michael Lass <bevan@bi-co.net> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: remove corrupted data indices in direct node blocksJaegeuk Kim2015-05-041-1/+11
| | | | | | | Previously, only data blocks locating in its inode block could be fixed. This patch investigates direct node blocks to fix indices too. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* mkfs.f2fs: avoid memory leak in mkfsChao Yu2015-05-041-16/+30
| | | | | | | This patch fixes memory leak in mkfs. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: support large sector sizeChao Yu2015-05-042-5/+8
| | | | | | | | | | | | 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>
* mkfs.f2fs: support large sector sizeChao Yu2015-05-043-16/+12
| | | | | | | | | | | | | | | | | | | | | | | 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 mkfs.f2fs still use default sector size: 512 bytes as sector size, let's fix this issue in this patch. v2: o remove unneeded printed message when sector size is large than 512 bytes suggested by Kinglong. o show correct sector size in printed message. o use config.sectors_per_blk instead of DEFAULT_SECTORS_PER_BLOCK suggested by Kinglong. v3: o remove another unneeded printed message when sector size is large than 512 bytes suggested by Kinglong. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Reviewed-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: fix build for androidDan Pasanen2015-05-041-0/+3
| | | | Change-Id: I5c3845703943dd48f97102908c2077b915501b4d
* fsck.f2fs: readahead node blocks to speed upJaegeuk Kim2015-05-043-1/+48
| | | | | | This patch adds readahead system call to speed up node block reads. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* dump.f2fs: show checkpoint flagJaegeuk Kim2015-05-042-0/+21
| | | | | | | | This patch is to show the checkpoint flag. With this flag, we can guess the last status of the partition. And, this can be used by xfstests. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: fix sit types seamlesslyJaegeuk Kim2015-05-041-9/+5
| | | | | | | SIT types can be wrong when active_logs are 2 or 4. So, let's fix this implicitly. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fibmap.f2fs: fix the wrong stat infoChao Yu2015-05-041-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fibmap shows ino, size, blocks with incorrectly decimal number, fix it. Before: -------------------------------------------- dev [8:16] ino [0x 238ea : 0] mode [0x 81a4 : 33188] nlink [0x 1 : 1] uid [0x 0 : 0] gid [0x 0 : 0] size [0x 79e00 : 0] blksize [0x 1000 : 4096] blocks [0x 268 : 0] -------------------------------------------- Patched: -------------------------------------------- dev [8:16] ino [0x 238ea : 145642] mode [0x 81a4 : 33188] nlink [0x 1 : 1] uid [0x 0 : 0] gid [0x 0 : 0] size [0x 79e00 : 499200] blksize [0x 1000 : 4096] blocks [0x 268 : 616] -------------------------------------------- Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* configure: add check for bswap_64Yann E. MORIN2015-05-042-1/+4
| | | | | | | | | | | | | | include/f2fs_fs.h checks the HAVE_BSWAP_64 conidtional, but configure nevers checks for it. Add a check that the function is indeed declared, and fix the variable name to match the naming scheme of autoconf (and not those of WAF like is used by samba), and adapt the check as suggested in the autoconf manual. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* configure: also check for byteswap.hYann E. MORIN2015-05-041-1/+1
| | | | | | | | | | | include/f2fs_fs.h checks the HAVE_BYTESWAP_H conditional, but it is never checked for in configure. Add that header to the list of headers checked for. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* parse.f2fs: add a tool to parse IO traces made by runtime f2fsJaegeuk Kim2015-05-042-1/+324
| | | | | | | This patch adds parse.f2fs to retrieve process information and an amount of data reads and writes from given IO trace got by f2fs. Signed-off-by: Jaegeuk Kim <jaegeuk@motorola.com>
* dump.f2fs: dump owner of data given block addressJaegeuk Kim2015-05-045-24/+169
| | | | | | | This patch introduces a feature to dump owner information of given block address. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: no need to fix SIT type for COLD_DATAJaegeuk Kim2015-05-041-3/+7
| | | | | | | If hot or warm data blocks were moved to the cold log, we should remain them in the cold log. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* mkfs.f2fs: introduce some macros to simplify coding styleChangman Lee2015-05-044-284/+272
| | | | | | | | | | | | | | | This patch tries to simplify coding style for readability. Rename shortly o rename super_block to sb And, introduce some macros. o set/get_cp o set/get_sb o next/prev_zone, last_zone and last_section o ALIGN, SEG_ALIGN and ZONE_ALIGN Signed-off-by: Changman Lee <cm224.lee@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: remove unused valueJaegeuk Kim2015-05-041-1/+0
| | | | | | Remove build warning. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* mkfs.f2fs: fix missing endian conversionChangman Lee2015-05-041-3/+3
| | | | | | | This is for conversion from cpu to little endian and vice versa. Signed-off-by: Changman Lee <cm224.lee@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* mkfs: use compact mode for data summariesChangman Lee2015-05-041-38/+64
| | | | | | | | | This patch is for optimization related to format o reduce 2 blocks for data summaries o reduce initial mount time after mkfs.f2fs Signed-off-by: Changman Lee <cm224.lee@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: add a missing 'fixed' during chk_dentries()JP Abgrall2015-05-041-0/+1
| | | | | | | | | One of the cases would update the dentries but not set fixed=1 causing the update to not be written out. Change-Id: I111d599f93f7d5306dacd7d62da946fdb5c262ee Signed-off-by: JP Abgrall <jpa@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: avoid false alarm on SIT type fixJaegeuk Kim2015-05-043-5/+32
| | | | | | This patch removed a false alarm when detecting any inconsistency in SIT types. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: remove unneeded returnJaegeuk Kim2015-05-041-3/+3
| | | | | | To show better output. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: show orphan inodes when fixing partitionJaegeuk Kim2015-05-041-3/+5
| | | | | | | Let's show orphan inode information when fixing partition. Otherwise, it causes a false alarm. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* mkfs.f2fs: reclaim free space in case of regular fileChangman Lee2015-05-042-3/+17
| | | | | | | | If we use regular file instead block device, let's reclaim its free space. Signed-off-by: Changman Lee <cm224.lee@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* mkfs.f2fs: give a kernel version for initial formatJaegeuk Kim2015-05-043-0/+17
| | | | | | This is to identify when the format was done. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fsck.f2fs: trigger fsck.f2fs when new change was madeJaegeuk Kim2015-05-044-2/+63
| | | | | | | 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>
* fsck.f2fs: fix SIT entry typesJaegeuk Kim2015-05-042-10/+38
| | | | | | Sometimes, SIT entry type is broken, so we need to rebuild it. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* Merge tag 'android-5.1.0_r1' into HEADstaging/cm-12.1stable/cm-12.1-YOG3CRicardo Cerqueira2015-03-100-0/+0
|\ | | | | | | Android 5.1.0 release 1
| * Update fsck to latest version (1.2 -> 1.4.0++ with better fix support)JP Abgrall2014-11-0718-817/+1649
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge remote-tracking branch 'goog/lmp-mr1-dev-plus-aosp' into update_to_140 * goog/lmp-mr1-dev-plus-aosp: (45 commits) fsck.f2fs: actually flag the fixed dentries as fixed f2fs: use last_blk for print dentries fsck.f2fs: fix DATA_EXIST flag for old partition fsck.f2fs: attempt to identify bad dentries Update build version from 1.2.0 to 1.4.0 after merge. fsck.f2fs: show inline status of inode fsck.f2fs: fix wrongly allocated 0'th block for inline_data fsck.f2fs: fix link count correctly fsck.f2fs: fix wrong hash_code made by previous buggy code fsck.f2fs: support inline_dentry fsck.f2fs: fix superblock offset mkfs.f2fs: avoid build warning fsck.f2fs: fix wrong block addres of nids mkfs.f2fs: possible endianes bug in mkfs.f2fs roll-forward speed f2fs-tools: fix for build big-endian processors f2fs-tools: release 1.4.0 f2fstat: enhance readability of output tracepoint.sh: update latest tracepoints f2fs: rearrange options to remove redundant check fsck.f2fs: add auto_fix feature ... Bug: 17640053 Bug: 18292088 Change-Id: Idab448af4fccd7033ca5e3e55e3f3472673df622 Signed-off-by: JP Abgrall <jpa@google.com>
* | \ Merge remote-tracking branch 'aosp/master' into cm-12.0stable/cm-12.0-YNG1TAstable/cm-12.0-YNG1Tstable/cm-12.0-YNG1IEthan Chen2015-01-2318-816/+1649
|\ \ \ | | |/ | |/| | | | Change-Id: I344bec1a7d0837d0775cfc133185b01db5a00366
| * | fsck.f2fs: actually flag the fixed dentries as fixedJP Abgrall2014-11-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a followup from 056e4b04fc44a006d5529bafbf87b1d73296c665 Now the blk is marked as fixed so that the callers can write it back. Change-Id: I99c94bc39e772e0d0baab81bd741ce55416ce0e6 Signed-off-by: JP Abgrall <jpa@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | f2fs: use last_blk for print dentriesJaegeuk Kim2014-11-071-1/+1
| | | | | | | | | | | | Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | fsck.f2fs: fix DATA_EXIST flag for old partitionJaegeuk Kim2014-11-072-0/+12
| | | | | | | | | | | | | | | | | | This should fix the DATA_EXIST before recent inline_data is enabled. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | fsck.f2fs: attempt to identify bad dentriesJP Abgrall2014-11-072-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a dentry has a bad ino (fsck_chk_nod_blk() fails) and has a name len of 0, then __chk_dentries() will end up stuck: .... [__chk_dentries: 663] [ 4]-[0x0] name[] len[0x0] ino[0x5f1710dc] type[0xd1] [ASSERT] (sanity_check_nid: 184) --> nid is not valid. [0x5f1710dc] [__chk_dentries: 663] [ 4]-[0x0] name[] len[0x0] ino[0x5f1710dc] type[0xd1] [ASSERT] (sanity_check_nid: 184) --> nid is not valid. [0x5f1710dc] [__chk_dentries: 663] [ 4]-[0x0] name[] len[0x0] ino[0x5f1710dc] type[0xd1] [ASSERT] (sanity_check_nid: 184) --> nid is not valid. [0x5f1710dc] .... This change tries to identify bad dentries: - is the ino a valid NID? - is the FILE_TYPE a happy type? Change-Id: I5fb2f3869c96f2c928baaace148de1af102e558e Signed-off-by: JP Abgrall <jpa@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | Update build version from 1.2.0 to 1.4.0 after merge.JP Abgrall2014-11-071-1/+1
| | | | | | | | | | | | Change-Id: I055399adc13a81a7007a5723720368274b012fe7
| * | fsck.f2fs: show inline status of inodeJaegeuk Kim2014-11-071-0/+1
| | | | | | | | | | | | | | | | | | This patch adds to show inline status of each inode. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | fsck.f2fs: fix wrongly allocated 0'th block for inline_dataJaegeuk Kim2014-11-071-2/+11
| | | | | | | | | | | | | | | | | | This patch fixes not to allocate any 0'th block for inline_data. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | fsck.f2fs: fix link count correctlyJaegeuk Kim2014-11-071-0/+1
| | | | | | | | | | | | | | | | | | We should do *goto check* if there is something to fix. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | fsck.f2fs: fix wrong hash_code made by previous buggy codeJaegeuk Kim2014-11-071-5/+27
| | | | | | | | | | | | | | | | | | | | | The previous f2fs remained wrong hash_code for international characters. So, fsck.f2fs should fix that hash_code with current valid names. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | fsck.f2fs: support inline_dentryJaegeuk Kim2014-11-074-41/+109
| | | | | | | | | | | | | | | | | | This patch implements inline_dentry feature. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | fsck.f2fs: fix superblock offsetJaegeuk Kim2014-11-071-1/+6
| | | | | | | | | | | | | | | | | | The second offset should be F2FS_BLKSIZE + F2FS_SUPER_OFFSET. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | mkfs.f2fs: avoid build warningJaegeuk Kim2014-11-071-1/+2
| | | | | | | | | | | | | | | | | | Avoid build warning for printf. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | fsck.f2fs: fix wrong block addres of nidsJaegeuk Kim2014-11-071-3/+1
| | | | | | | | | | | | | | | | | | | | | This patch avoids assert when nid has wrong block address. Let's fix this. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | mkfs.f2fs: possible endianes bug in mkfs.f2fs roll-forward speedjoerg jungermann2014-11-071-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I might found a bug in mkfs.f2fs. while experimenting with f2fs on my big endian MIPS32 device (platform lantiq, 14.07-rc3, uclibc). I ran into an issue that mkfs.f2fs, was not able to format block devices if I did not specify the sector count manually. I hunted it down to lib/libf2fs.c. After I found that the detected sector count equals to the wanted sector count shifted left (32+9) times. I found two issues: Firstly it uses ioctl BLKGETSIZE, which writes to an uint32_t the size of the device. As c->total_sectors is of type uint64_t, the value is written in to the first 4 bytes. That explained the left shift of 32 bits. Secondly BLKGETSIZE determines the size of the device in bytes (AFAIK, learned by observation). In the first branch of the if-block patched below, the c->total_sectors is calculated by c->total_sectors = stat_buf.st_size / c->sector_size; The else branch omits the devision. sector_sice is mostly 512, that explained the left shift by 9 bytes. * fixes sector count calculation * uses BLKGETSIZE64 if avail Signed-off-by: joerg jungermann <jj@borkum.net> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | f2fs-tools: fix for build big-endian processorsJaegeuk Kim2014-11-071-0/+60
| | | | | | | | | | | | | | | | | | | | | This patch fixes build failure on big-endian systems. Reported-and-Tested-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | f2fs-tools: release 1.4.0Jaegeuk Kim2014-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This version includes: - fsck.f2fs fixing corrupted images/partitions - dump.f2fs retrieving speicific file - bug fixes on f2fsstat and fibmap.f2fs - refactor code blocks for android build Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | f2fstat: enhance readability of outputJaegeuk Kim2014-11-071-12/+71
| | | | | | | | | | | | | | | | | | This patch enhances output readability of f2fstat. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| * | tracepoint.sh: update latest tracepointsJaegeuk Kim2014-11-071-2/+8
| | | | | | | | | | | | Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>