linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: fix early abort in 'remount'
@ 2012-04-15 22:46 Sergei Trofimovich
  2012-04-16  1:12 ` Liu Bo
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Trofimovich @ 2012-04-15 22:46 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Sergei Trofimovich, Jeff Mahoney, Chris Mason, Josef Bacik

From: Sergei Trofimovich <slyfox@gentoo.org>

Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Josef Bacik <josef@redhat.com>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 fs/btrfs/super.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 8d5d380..0b296f2 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -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)
-- 
1.7.8.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs: fix early abort in 'remount'
  2012-04-15 22:46 [PATCH] btrfs: fix early abort in 'remount' Sergei Trofimovich
@ 2012-04-16  1:12 ` Liu Bo
  2012-04-16  3:44   ` [PATCH v2] " Sergei Trofimovich
  0 siblings, 1 reply; 5+ messages in thread
From: Liu Bo @ 2012-04-16  1:12 UTC (permalink / raw)
  To: Sergei Trofimovich
  Cc: linux-btrfs, Sergei Trofimovich, Jeff Mahoney, Chris Mason,
	Josef Bacik

On 04/16/2012 06:46 AM, Sergei Trofimovich wrote:

> From: Sergei Trofimovich <slyfox@gentoo.org>
> 
> Cc: Jeff Mahoney <jeffm@suse.com>
> Cc: Chris Mason <chris.mason@oracle.com>
> Cc: Josef Bacik <josef@redhat.com>
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> ---
>  fs/btrfs/super.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 8d5d380..0b296f2 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -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)


I prefer to
if (xxx) {
	yyy;
}

thanks, 
liubo 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] btrfs: fix early abort in 'remount'
  2012-04-16  1:12 ` Liu Bo
@ 2012-04-16  3:44   ` Sergei Trofimovich
  2012-04-16 11:52     ` Sergey V.
  2012-04-16 13:55     ` Josef Bacik
  0 siblings, 2 replies; 5+ messages in thread
From: Sergei Trofimovich @ 2012-04-16  3:44 UTC (permalink / raw)
  To: linux-btrfs
  Cc: Liu Bo, Sergei Trofimovich, Jeff Mahoney, Chris Mason,
	Josef Bacik

From: Sergei Trofimovich <slyfox@gentoo.org>

Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Josef Bacik <josef@redhat.com>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 fs/btrfs/super.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 8d5d380..2f28fc0 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -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)
-- 
1.7.8.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] btrfs: fix early abort in 'remount'
  2012-04-16  3:44   ` [PATCH v2] " Sergei Trofimovich
@ 2012-04-16 11:52     ` Sergey V.
  2012-04-16 13:55     ` Josef Bacik
  1 sibling, 0 replies; 5+ messages in thread
From: Sergey V. @ 2012-04-16 11:52 UTC (permalink / raw)
  To: Sergei Trofimovich
  Cc: linux-btrfs, Liu Bo, Sergei Trofimovich, Jeff Mahoney,
	Chris Mason, Josef Bacik

On Monday 16 of April 2012 07:44:37 Sergei Trofimovich wrote:
> From: Sergei Trofimovich <slyfox@gentoo.org>
> 
> Cc: Jeff Mahoney <jeffm@suse.com>
> Cc: Chris Mason <chris.mason@oracle.com>
> Cc: Josef Bacik <josef@redhat.com>
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> ---
>  fs/btrfs/super.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 8d5d380..2f28fc0 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -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)
> -- 

Patch is correct

Reviewed-by: Sergey V. <sftp.mtuci@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] btrfs: fix early abort in 'remount'
  2012-04-16  3:44   ` [PATCH v2] " Sergei Trofimovich
  2012-04-16 11:52     ` Sergey V.
@ 2012-04-16 13:55     ` Josef Bacik
  1 sibling, 0 replies; 5+ messages in thread
From: Josef Bacik @ 2012-04-16 13:55 UTC (permalink / raw)
  To: Sergei Trofimovich
  Cc: linux-btrfs, Liu Bo, Sergei Trofimovich, Jeff Mahoney,
	Chris Mason, Josef Bacik

On Mon, Apr 16, 2012 at 06:44:37AM +0300, Sergei Trofimovich wrote:
> From: Sergei Trofimovich <slyfox@gentoo.org>
> 
> Cc: Jeff Mahoney <jeffm@suse.com>
> Cc: Chris Mason <chris.mason@oracle.com>
> Cc: Josef Bacik <josef@redhat.com>
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> ---
>  fs/btrfs/super.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 8d5d380..2f28fc0 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -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)
> -- 
> 1.7.8.5
> 

Haha oops,

Reviewed-by: Josef Bacik <josef@redhat.com>

Thanks,

Josef

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-16 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-15 22:46 [PATCH] btrfs: fix early abort in 'remount' Sergei Trofimovich
2012-04-16  1:12 ` Liu Bo
2012-04-16  3:44   ` [PATCH v2] " Sergei Trofimovich
2012-04-16 11:52     ` Sergey V.
2012-04-16 13:55     ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).