Re: [PATCH 2/2] xfsprogs: dont free xfs_inode until complete

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

 



On Wed, Apr 30, 2014 at 08:48:46AM -0500, Mark Tinguely wrote:
> Originally, the xfs_inode are released upon the first
> call to xfs_trans_cancel, xfs_trans_commit, or
> inode_item_done. This code used the log item lock field
> to prevent the release of the inode on the next call to
> one of the above functions. This is a unusual use of the
> log item lock field which is suppose to specify which lock
> is to be release on transaction commit or cancel. User
> space does not perform locking in transactions..
> 
> Unfortunately, this breaks any code that relies on multiple
> transaction operations. For example, adding an extended
> attribute to an inode that does not have an attribute fork
> will fail:
> 
>  # xfs_db -x XFS_DEVICE
>  xfs_db> inode INO_NUM
>  xfs_db> attr_set newattribute
> 
> This patch does the following:
>  1) Removes the iput from the transaction completion and
>     requires that the xfs_inode allocators call IRELE()
>     when they are done with the pointer. The real time
>     inodes are pointed to by the xfs_mount and have a longer
>     lifetime.

Makes sense, the kernel hasn't done an iput during transaction
completion for a long time.

>  2) Removes libxfs_trans_iput() because transaction entries
>     are removed in transaction commit and cancel.

Also matches the kernel and makes sense.

>  3) Removes libxfs_trans_ihold() which is an obsolete interface.

Ditto.

>  4) Removes the now unneeded ili_flags from the xfs_inode_log_item
>     structure.

ili_lock_flags, not ili_flags.  Given that we never lock inodes in
userspace there is no need to unlock them during transaction commit,
and no need to track this.  There's also no shared code that references
this field, so it can safely go.

The patch looks good to me, and having consistent behavior with the
kernel code is very useful to have!

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




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

  Powered by Linux