From: David Sterba Date: Wed, 5 Feb 2020 16:12:28 +0000 (+0100) Subject: btrfs: log message when rw remount is attempted with unclean tree-log X-Git-Tag: v5.5.5~57 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f7447ff1d58a590e4b04479d1209fcee253a96d7;p=users%2Fdwmw2%2Flinux.git btrfs: log message when rw remount is attempted with unclean tree-log commit 10a3a3edc5b89a8cd095bc63495fb1e0f42047d9 upstream. 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: stable@vger.kernel.org # 4.4+ Reviewed-by: Anand Jain Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 6ccfef72d0e1d..c6557d44907a9 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1803,6 +1803,8 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) } if (btrfs_super_log_root(fs_info->super_copy) != 0) { + btrfs_warn(fs_info, + "mount required to replay tree-log, cannot remount read-write"); ret = -EINVAL; goto restore; }