f2fs: fix to skip recovering dot dentries in a readonly fs
authorChao Yu <chao2.yu@samsung.com>
Wed, 30 Dec 2015 09:40:31 +0000 (17:40 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 30 Dec 2015 18:51:28 +0000 (10:51 -0800)
If filesystem is readonly, leave user message info instead of recovering
inline dot inode.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/namei.c

index 6c4a94310b541c89081f227faa7d9706251499c7..a629af5cb0ce6cc4f37ed6c0609862546f4282cc 100644 (file)
@@ -214,6 +214,13 @@ static int __recover_dot_dentries(struct inode *dir, nid_t pino)
        struct page *page;
        int err = 0;
 
+       if (f2fs_readonly(sbi->sb)) {
+               f2fs_msg(sbi->sb, KERN_INFO,
+                       "skip recovering inline_dots inode (ino:%lu, pino:%u) "
+                       "in readonly mountpoint", dir->i_ino, pino);
+               return 0;
+       }
+
        f2fs_balance_fs(sbi);
 
        f2fs_lock_op(sbi);