]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/f2fs/recovery.c
Merge branch 'for-linus' into for-4.12/block
[karo-tx-linux.git] / fs / f2fs / recovery.c
index 981a9584b62fbeb8dfbd0ef9104c8d5ee86272fc..d025aa83fb5bb344fcb5799f080d033895e584aa 100644 (file)
@@ -378,11 +378,9 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
        if (IS_INODE(page)) {
                recover_inline_xattr(inode, page);
        } else if (f2fs_has_xattr_block(ofs_of_node(page))) {
-               /*
-                * Deprecated; xattr blocks should be found from cold log.
-                * But, we should remain this for backward compatibility.
-                */
-               recover_xattr_data(inode, page, blkaddr);
+               err = recover_xattr_data(inode, page, blkaddr);
+               if (!err)
+                       recovered++;
                goto out;
        }
 
@@ -428,8 +426,9 @@ retry_dn:
                }
 
                if (!file_keep_isize(inode) &&
-                               (i_size_read(inode) <= (start << PAGE_SHIFT)))
-                       f2fs_i_size_write(inode, (start + 1) << PAGE_SHIFT);
+                       (i_size_read(inode) <= ((loff_t)start << PAGE_SHIFT)))
+                       f2fs_i_size_write(inode,
+                               (loff_t)(start + 1) << PAGE_SHIFT);
 
                /*
                 * dest is reserved block, invalidate src block
@@ -552,10 +551,8 @@ next:
 
 int recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
 {
-       struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_WARM_NODE);
        struct list_head inode_list;
        struct list_head dir_list;
-       block_t blkaddr;
        int err;
        int ret = 0;
        bool need_writecp = false;
@@ -571,8 +568,6 @@ int recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
        /* prevent checkpoint */
        mutex_lock(&sbi->cp_mutex);
 
-       blkaddr = NEXT_FREE_BLKADDR(sbi, curseg);
-
        /* step #1: find fsynced inode numbers */
        err = find_fsync_dnodes(sbi, &inode_list);
        if (err || list_empty(&inode_list))