Re: [PATCH] Btrfs: clean up error handling in btrfs_truncate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 29, 2018 at 12:24:31PM -0700, Omar Sandoval wrote:
> On Tue, May 22, 2018 at 09:59:50AM -0700, Omar Sandoval wrote:
> > From: Omar Sandoval <osandov@xxxxxx>
> > 
> > btrfs_truncate() uses two variables for error handling, ret and err (if
> > this sounds familiar, it's because btrfs_truncate_inode_items() did
> > something similar). This is error prone, as was made evident by "Btrfs:
> > fix error handling in btrfs_truncate()". We only have err because we
> > don't want to mask an error if we call btrfs_update_inode() and
> > btrfs_end_transaction(), so let's make that its own scoped return
> > variable and use ret everywhere else.
> > 
> > Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx>
> > Signed-off-by: Omar Sandoval <osandov@xxxxxx>
> > ---
> > This is the same as my v1 "Btrfs: fix error handling in
> > btrfs_truncate()", but rebased on top of kdave/for-next + v2 of "Btrfs:
> > fix error handling in btrfs_truncate()".
> > 
> >  fs/btrfs/inode.c | 33 ++++++++++++++-------------------
> >  1 file changed, 14 insertions(+), 19 deletions(-)
> 
> Dave, what are your thoughts on this one? Are you thinking 4.18 or 4.19?

This one is still ok for 4.18.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux