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: v4.19.105~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3eccdff2ce26a09a2ee4bb21ea453c5e4af303b;p=thirdparty%2Fkernel%2Fstable.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 db4002ecbaca3..6a5b16a119eda 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1857,6 +1857,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; }