Skip to content

Commit 10a3a3e

Browse files
committed
btrfs: log message when rw remount is attempted with unclean tree-log
A remount to a read-write filesystem is not safe when there's tree-log to be replayed. Files that could be opened until now might be affected by the changes in the tree-log. A regular mount is needed to replay the log so the filesystem presents the consistent view with the pending changes included. CC: [email protected] # 4.4+ Reviewed-by: Anand Jain <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent e8294f2 commit 10a3a3e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/super.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,6 +1834,8 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
18341834
}
18351835

18361836
if (btrfs_super_log_root(fs_info->super_copy) != 0) {
1837+
btrfs_warn(fs_info,
1838+
"mount required to replay tree-log, cannot remount read-write");
18371839
ret = -EINVAL;
18381840
goto restore;
18391841
}

0 commit comments

Comments
 (0)