Re: [PATCH 1/2] btrfs: Explicitly handle btrfs_update_root failure

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

 



On Thu, Sep 28, 2017 at 10:53:17AM +0300, Nikolay Borisov wrote:
> btrfs_udpate_root can fail and it aborts the transaction, the correct way to
> handle an aborted transaction is to explicitly end with btrfs_end_transaction.
> Even now the code is correct since btrfs_commit_transaction would handle an
> aborted transaction but this is more of an implementation detail. So let's be
> explicit in handling failure in btrfs_update_root.
> 
> Furthermore btrfs_commit_transaction can also fail and by ignoring it's return
> value we could have left the in-memory copy of the root item in an inconsistent
> state. So capture the error value which allows us to correctly revert the RO/RW
> flags in case of commit failure.
> 
> Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx>

Reviewed-by: David Sterba <dsterba@xxxxxxxx>
--
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