linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Mark Tinguely <tinguely@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/2] xfsprogs: dont free xfs_inode until complete
Date: Wed, 30 Apr 2014 08:14:31 -0700	[thread overview]
Message-ID: <20140430151431.GC15162@infradead.org> (raw)
In-Reply-To: <20140430135319.750775813@sgi.com>

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@lst.de>

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

  reply	other threads:[~2014-04-30 15:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 13:48 [PATCH 0/2] xfsprog: fix xfs_inode lifetime issue Mark Tinguely
2014-04-30 13:48 ` [PATCH 1/2] xfsprogs: remove unused argument in trans_iput Mark Tinguely
2014-04-30 14:47   ` Eric Sandeen
2014-04-30 14:50     ` Mark Tinguely
2014-04-30 15:02       ` Eric Sandeen
2014-04-30 15:10     ` Christoph Hellwig
2014-04-30 15:10   ` Christoph Hellwig
2014-04-30 13:48 ` [PATCH 2/2] xfsprogs: dont free xfs_inode until complete Mark Tinguely
2014-04-30 15:14   ` Christoph Hellwig [this message]
2014-05-01 23:33 ` [PATCH 0/2] xfsprog: fix xfs_inode lifetime issue Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140430151431.GC15162@infradead.org \
    --to=hch@infradead.org \
    --cc=tinguely@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).