On Fri, May 3, 2019 at 4:21 PM Josef Bacik <[email protected]> wrote: > > If we have an error writing out a delalloc range in > btrfs_punch_hole_lock_range we'll unlock the inode and then goto > out_only_mutex, where we will again unlock the inode. This is bad, > don't do this. > > Signed-off-by: Josef Bacik <[email protected]>
Reviewed-by: Filipe Manana <[email protected]> Looks good, I introduced the double unlock accidentally. > --- > fs/btrfs/file.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c > index 7f7833149cb7..d23ea0b388e0 100644 > --- a/fs/btrfs/file.c > +++ b/fs/btrfs/file.c > @@ -2554,10 +2554,8 @@ static int btrfs_punch_hole(struct inode *inode, > loff_t offset, loff_t len) > > ret = btrfs_punch_hole_lock_range(inode, lockstart, lockend, > &cached_state); > - if (ret) { > - inode_unlock(inode); > + if (ret) > goto out_only_mutex; > - } > > path = btrfs_alloc_path(); > if (!path) { > -- > 2.13.5 > -- Filipe David Manana, “Whether you think you can, or you think you can't — you're right.”
