btrfs: handle btrfs_record_root_in_trans failure in btrfs_rename
btrfs_record_root_in_trans will return errors in the future, so handle the error properly in btrfs_rename. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
00aa8e87c9
commit
b0fec6fd33
@ -9416,8 +9416,11 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
goto out_notrans;
|
||||
}
|
||||
|
||||
if (dest != root)
|
||||
btrfs_record_root_in_trans(trans, dest);
|
||||
if (dest != root) {
|
||||
ret = btrfs_record_root_in_trans(trans, dest);
|
||||
if (ret)
|
||||
goto out_fail;
|
||||
}
|
||||
|
||||
ret = btrfs_set_inode_index(BTRFS_I(new_dir), &index);
|
||||
if (ret)
|
||||
|
Loading…
Reference in New Issue
Block a user