fsck: skip to check block addresses in device files
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 8 Oct 2013 09:17:33 +0000 (18:17 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 8 Oct 2013 09:17:33 +0000 (18:17 +0900)
The device files use i_addr or i_nid fields for their rdev numbers.
So, fsck should skip to check block addresses inside of them.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fsck/fsck.c

index d491a3d..d5efb63 100644 (file)
@@ -333,6 +333,10 @@ int fsck_chk_inode_blk(struct f2fs_sb_info *sbi,
 
        fsck_chk_xattr_blk(sbi, nid, le32_to_cpu(node_blk->i.i_xattr_nid), blk_cnt);
 
+       if (ftype & F2FS_FT_CHRDEV || ftype & F2FS_FT_BLKDEV ||
+                       ftype & F2FS_FT_FIFO || ftype & F2FS_FT_SOCK)
+               goto check;
+
        /* check data blocks in inode */
        for (idx = 0; idx < ADDRS_PER_INODE(&node_blk->i); idx++) {
                if (le32_to_cpu(node_blk->i.i_addr[idx]) != 0) {
@@ -373,7 +377,7 @@ int fsck_chk_inode_blk(struct f2fs_sb_info *sbi,
                        ASSERT(ret >= 0);
                }
        }
-
+check:
        if (ftype & F2FS_FT_DIR)
                DBG(1, "Directory Inode: ino: %x name: %s depth: %d child files: %d\n\n",
                                le32_to_cpu(node_blk->footer.ino), node_blk->i.i_name,
@@ -606,6 +610,7 @@ int fsck_chk_data_blk(struct f2fs_sb_info *sbi,
                u8 ver)
 {
        struct f2fs_fsck *fsck = F2FS_FSCK(sbi);
+
        /* Is it reserved block? */
        if (blk_addr == NEW_ADDR) {
                fsck->chk.valid_blk_cnt++;