btrfs: fix early abort in 'remount'
PATCH 1/1 btrfs: fix early abort in 'remount'
From: Sergei Trofimovich <[email protected]>
Cc Jeff Mahoney <[email protected]>
Cc Chris Mason <[email protected]>
Cc Josef Bacik <[email protected]>
Signed-off-by Sergei Trofimovich <[email protected]>
--- fs/btrfs/super.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
fs/btrfs/super.c +4 -0
@@ -1149,12 +1149,16 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) goto restore; }else {if (fs_info->fs_devices->rw_devices ==0 ) + { ret = -EACCES ; goto restore; + }if (btrfs_super_log_root (fs_info->super_copy) !=0 ) + { ret = -EINVAL ; goto restore; + } ret =btrfs_cleanup_fs_roots (fs_info);if (ret)
Signature · 1 line
1.7.8.5
Quoted 21 lines · Sergei Trofimovich
From: Sergei Trofimovich <[email protected]>
Cc Jeff Mahoney <[email protected]>Cc Chris Mason <[email protected]>Cc Josef Bacik <[email protected]>Signed-off-by Sergei Trofimovich <[email protected]>--- fs/btrfs/super.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)fs/btrfs/super.c +1
-0@@ -1149,12 +1149,16 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) goto restore; }else {if (fs_info->fs_devices->rw_devices ==0 ) + { ret = -EACCES ; goto restore;
fs/btrfs/super.c static int btrfs_remount(struct super_block *sb, int *flags, char *data) · line 1164
Quoted 10 lines
fs/btrfs/super.c +3
-0+ }if (btrfs_super_log_root (fs_info->super_copy) !=0 ) + { ret = -EINVAL ; goto restore; + } ret =btrfs_cleanup_fs_roots (fs_info);if (ret)
I prefer to
if (xxx) {
yyy;
}thanks,
liubo
PATCH v2 1/1 btrfs: fix early abort in 'remount'
From: Sergei Trofimovich <[email protected]>
Cc Jeff Mahoney <[email protected]>
Cc Chris Mason <[email protected]>
Cc Josef Bacik <[email protected]>
Signed-off-by Sergei Trofimovich <[email protected]>
--- fs/btrfs/super.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
fs/btrfs/super.c +4 -2
@@ -1148,13 +1148,15 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)if (ret) goto restore; }else { -if (fs_info->fs_devices->rw_devices ==0 ) +if (fs_info->fs_devices->rw_devices ==0 ) { ret = -EACCES ; goto restore; + } -if (btrfs_super_log_root (fs_info->super_copy) !=0 ) +if (btrfs_super_log_root (fs_info->super_copy) !=0 ) { ret = -EINVAL ; goto restore; + } ret =btrfs_cleanup_fs_roots (fs_info);if (ret)
Signature · 1 line
1.7.8.5
Quoted 23 lines · On Monday 16 of April 2012 07:44:37 Sergei Trofimovich wrote:
From: Sergei Trofimovich <[email protected]>
Cc Jeff Mahoney <[email protected]>Cc Chris Mason <[email protected]>Cc Josef Bacik <[email protected]>Signed-off-by Sergei Trofimovich <[email protected]>--- fs/btrfs/super.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)fs/btrfs/super.c +1
-1@@ -1148,13 +1148,15 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)if (ret) goto restore; }else { -if (fs_info->fs_devices->rw_devices ==0 ) +if (fs_info->fs_devices->rw_devices ==0 ) { ret = -EACCES ; goto restore;
fs/btrfs/super.c static int btrfs_remount(struct super_block *sb, int *flags, char *data) · line 1162
Quoted 10 lines
fs/btrfs/super.c +3
-1+ } -if (btrfs_super_log_root (fs_info->super_copy) !=0 ) +if (btrfs_super_log_root (fs_info->super_copy) !=0 ) { ret = -EINVAL ; goto restore; + } ret =btrfs_cleanup_fs_roots (fs_info);if (ret)
Patch is correct
Reviewed-by Sergey V. <[email protected]>
Thanks.
Quoted 35 lines · Sergei Trofimovich
From: Sergei Trofimovich <[email protected]>
Cc Jeff Mahoney <[email protected]>Cc Chris Mason <[email protected]>Cc Josef Bacik <[email protected]>Signed-off-by Sergei Trofimovich <[email protected]>--- fs/btrfs/super.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)fs/btrfs/super.c +4
-2@@ -1148,13 +1148,15 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)if (ret) goto restore; }else { -if (fs_info->fs_devices->rw_devices ==0 ) +if (fs_info->fs_devices->rw_devices ==0 ) { ret = -EACCES ; goto restore; + } -if (btrfs_super_log_root (fs_info->super_copy) !=0 ) +if (btrfs_super_log_root (fs_info->super_copy) !=0 ) { ret = -EINVAL ; goto restore; + } ret =btrfs_cleanup_fs_roots (fs_info);if (ret)Signature · 1 line
1.7.8.5
Haha oops,
Reviewed-by Josef Bacik <[email protected]>
Thanks,
Josef