diff mbox

btrfs: No need to check !(flags & MS_RDONLY) twice

Message ID 20170304183250.32295-1-rgoldwyn@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Goldwyn Rodrigues March 4, 2017, 6:32 p.m. UTC
From: Goldwyn Rodrigues <rgoldwyn@suse.com>

Code cleanup.
The code block is for !(*flags & MS_RDONLY). We don't need
to check it again.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
 fs/btrfs/super.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Omar Sandoval March 6, 2017, 5:41 p.m. UTC | #1
On Sat, Mar 04, 2017 at 12:32:50PM -0600, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues <rgoldwyn@suse.com>
> 
> Code cleanup.
> The code block is for !(*flags & MS_RDONLY). We don't need
> to check it again.

Reviewed-by: Omar Sandoval <osandov@fb.com>

> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
> ---
>  fs/btrfs/super.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index da687dc..e9ae93e 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1785,8 +1785,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
>  		}
>  
>  		if (fs_info->fs_devices->missing_devices >
> -		     fs_info->num_tolerated_disk_barrier_failures &&
> -		    !(*flags & MS_RDONLY)) {
> +		     fs_info->num_tolerated_disk_barrier_failures) {
>  			btrfs_warn(fs_info,
>  				"too many missing devices, writeable remount is not allowed");
>  			ret = -EACCES;
> -- 
> 2.10.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Sterba March 7, 2017, 5:36 p.m. UTC | #2
On Mon, Mar 06, 2017 at 09:41:51AM -0800, Omar Sandoval wrote:
> On Sat, Mar 04, 2017 at 12:32:50PM -0600, Goldwyn Rodrigues wrote:
> > From: Goldwyn Rodrigues <rgoldwyn@suse.com>
> > 
> > Code cleanup.
> > The code block is for !(*flags & MS_RDONLY). We don't need
> > to check it again.
> 
> Reviewed-by: Omar Sandoval <osandov@fb.com>

Added to queue, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index da687dc..e9ae93e 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1785,8 +1785,7 @@  static int btrfs_remount(struct super_block *sb, int *flags, char *data)
 		}
 
 		if (fs_info->fs_devices->missing_devices >
-		     fs_info->num_tolerated_disk_barrier_failures &&
-		    !(*flags & MS_RDONLY)) {
+		     fs_info->num_tolerated_disk_barrier_failures) {
 			btrfs_warn(fs_info,
 				"too many missing devices, writeable remount is not allowed");
 			ret = -EACCES;