Re: [PATCH 1/2] Btrfs: fix return value on rename exchange failure

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

 



On Mon, Jun 11, 2018 at 07:24:16PM +0100, fdmanana@xxxxxxxxxx wrote:
> From: Filipe Manana <fdmanana@xxxxxxxx>
> 
> If we failed during a rename exchange operation after starting/joining a
> transaction, we would end up replacing the return value, stored in the
> local 'ret' variable, with the return value from btrfs_end_transaction().
> So this could end up returning 0 (success) to user space despite the
> operation having failed and aborted the transaction, because if there are
> multiple tasks having a reference on the transaction at the time
> btrfs_end_transaction() is called by the rename exchange, that function
> returns 0 (otherwise it returns -EIO and not the original error value).
> So fix this by not overwriting the return value on error after getting
> a transaction handle.
> 
> Signed-off-by: Filipe Manana <fdmanana@xxxxxxxx>

1 and 2 queued for 4.18, thanks.
--
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