[3/8] btrfs: btrfs_bio_clone never fails, skip error handling
diff mbox

Message ID aa834758a79dc983410da678aac76d039b4cfdc2.1496422340.git.dsterba@suse.com
State New
Headers show

Commit Message

David Sterba June 2, 2017, 4:58 p.m. UTC
Update direct callers of btrfs_bio_clone that do error handling, that we
can now remove.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/inode.c   | 4 ----
 fs/btrfs/volumes.c | 1 -
 2 files changed, 5 deletions(-)

Comments

Anand Jain June 7, 2017, 9:11 a.m. UTC | #1
On 06/03/17 00:58, David Sterba wrote:
> Update direct callers of btrfs_bio_clone that do error handling, that we
> can now remove.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
--
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
Omar Sandoval June 7, 2017, 6:19 p.m. UTC | #2
On Fri, Jun 02, 2017 at 06:58:36PM +0200, David Sterba wrote:
> Update direct callers of btrfs_bio_clone that do error handling, that we
> can now remove.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/inode.c   | 4 ----
>  fs/btrfs/volumes.c | 1 -
>  2 files changed, 5 deletions(-)
> 
>  
>  		if (dev_nr < total_devs - 1) {
>  			bio = btrfs_bio_clone(first_bio, GFP_NOFS);
> -			BUG_ON(!bio); /* -ENOMEM */
>  		} else
>  			bio = first_bio;

Could you please get rid of the extra curly braces now, too?
--
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 June 12, 2017, 1:13 p.m. UTC | #3
On Wed, Jun 07, 2017 at 11:19:37AM -0700, Omar Sandoval wrote:
> On Fri, Jun 02, 2017 at 06:58:36PM +0200, David Sterba wrote:
> > Update direct callers of btrfs_bio_clone that do error handling, that we
> > can now remove.
> > 
> > Signed-off-by: David Sterba <dsterba@suse.com>
> > ---
> >  fs/btrfs/inode.c   | 4 ----
> >  fs/btrfs/volumes.c | 1 -
> >  2 files changed, 5 deletions(-)
> > 
> >  
> >  		if (dev_nr < total_devs - 1) {
> >  			bio = btrfs_bio_clone(first_bio, GFP_NOFS);
> > -			BUG_ON(!bio); /* -ENOMEM */
> >  		} else
> >  			bio = first_bio;
> 
> Could you please get rid of the extra curly braces now, too?

Sure, patch updated.
--
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

Patch
diff mbox

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0a1ec5cd3b8f..c8ed81edd40e 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8584,10 +8584,6 @@  static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode,
 	skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM;
 
 	bio = btrfs_bio_clone(dio_bio, GFP_NOFS);
-	if (!bio) {
-		ret = -ENOMEM;
-		goto free_ordered;
-	}
 
 	dip = kzalloc(sizeof(*dip), GFP_NOFS);
 	if (!dip) {
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index e28c113785bb..864b203cc4aa 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6257,7 +6257,6 @@  int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
 
 		if (dev_nr < total_devs - 1) {
 			bio = btrfs_bio_clone(first_bio, GFP_NOFS);
-			BUG_ON(!bio); /* -ENOMEM */
 		} else
 			bio = first_bio;