Merge 4.14.99 into android-4.14-p
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / fs / f2fs / f2fs.h
index 819dfc6690421403e656f85da86a0726fd7602b5..f1ff407d168e829c314137b8c6ac0cd9c9be7926 100644 (file)
@@ -2509,10 +2509,19 @@ static inline bool is_dot_dotdot(const struct qstr *str)
 
 static inline bool f2fs_may_extent_tree(struct inode *inode)
 {
-       if (!test_opt(F2FS_I_SB(inode), EXTENT_CACHE) ||
+       struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
+
+       if (!test_opt(sbi, EXTENT_CACHE) ||
                        is_inode_flag_set(inode, FI_NO_EXTENT))
                return false;
 
+       /*
+        * for recovered files during mount do not create extents
+        * if shrinker is not registered.
+        */
+       if (list_empty(&sbi->s_list))
+               return false;
+
        return S_ISREG(inode->i_mode);
 }