]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - repair/phase6.c
libxfs: dont free xfs_inode until complete
authorMark Tinguely <tinguely@sgi.com>
Tue, 20 May 2014 08:30:11 +0000 (18:30 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 20 May 2014 08:30:11 +0000 (18:30 +1000)
commit260c85e85e5ffb250c210f32d8740cadf6b720b2
tree1a788faaca879944f5b96732be6d6cb8ad42b976
parentdd2c21d23808db5d074e5c3ffe799b94936b9d81
libxfs: dont free xfs_inode until complete

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.
 2) Removes libxfs_trans_iput() because transaction entries
    are removed in transaction commit and cancel.
 3) Removes libxfs_trans_ihold() which is an obsolete interface.
 4) Removes the now unneeded ili_ilock_flags from the
    xfs_inode_log_item structure.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/libxfs.h
libxfs/trans.c
libxfs/util.c
libxfs/xfs.h
mkfs/proto.c
repair/phase6.c
repair/phase7.c