public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/3] xfs: unlock the inode before log force in xfs_fsync
Date: Mon, 19 Sep 2011 08:59:03 +1000	[thread overview]
Message-ID: <20110918225903.GC15688@dastard> (raw)
In-Reply-To: <20110918204909.860669185@bombadil.infradead.org>

On Sun, Sep 18, 2011 at 04:47:49PM -0400, Christoph Hellwig wrote:
> Only read the LSN we need to push to with the ilock held, and then release
> it before we do the log force to improve concurrency.
> 
> This also removes the only direct caller of _xfs_trans_commit, thus
> allowing it to be merged into the plain xfs_trans_commit again.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: xfs/fs/xfs/xfs_file.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_file.c	2011-09-07 10:59:55.742961175 +0200
> +++ xfs/fs/xfs/xfs_file.c	2011-09-07 11:08:12.830462974 +0200
> @@ -137,6 +137,7 @@ xfs_file_fsync(
>  	struct xfs_trans	*tp;
>  	int			error = 0;
>  	int			log_flushed = 0;
> +	xfs_lsn_t		lsn = 0;
>  
>  	trace_xfs_file_fsync(ip);
>  
> @@ -214,8 +215,10 @@ xfs_file_fsync(
>  		 */
>  		xfs_trans_ijoin(tp, ip);
>  		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
> -		xfs_trans_set_sync(tp);
> -		error = _xfs_trans_commit(tp, 0, &log_flushed);
> +		error = xfs_trans_commit(tp, 0);
> +
> +		ASSERT(xfs_ipincount(ip));

That's a racy assert. If the trans commit causes the CIL to be
pushed, that could complete and unpin the inode before we start
executing here again and check the pin count.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

  reply	other threads:[~2011-09-18 22:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-18 20:47 [PATCH 0/3] try to avoid locked inodes during log force Christoph Hellwig
2011-09-18 20:47 ` [PATCH 1/3] xfs: unlock the inode before log force in xfs_fsync Christoph Hellwig
2011-09-18 22:59   ` Dave Chinner [this message]
2011-09-19 14:55     ` [PATCH 1/3 v2] " Christoph Hellwig
2011-09-29 16:59   ` [PATCH 1/3] " Alex Elder
2011-09-18 20:47 ` [PATCH 2/3] xfs: unlock the inode before log force in xfs_fs_nfs_commit_metadata Christoph Hellwig
2011-09-18 23:00   ` Dave Chinner
2011-09-29 16:59   ` Alex Elder
2011-09-18 20:47 ` [PATCH 3/3] xfs: unlock the inode before log force in xfs_change_file_space Christoph Hellwig
2011-09-18 23:00   ` Dave Chinner
2011-09-29 16:59   ` Alex Elder

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=20110918225903.GC15688@dastard \
    --to=david@fromorbit.com \
    --cc=hch@infradead.org \
    --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