linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
To: "Jörn Engel" <joern@lazybastard.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Chinner <dgc@sgi.com>, Anton Altaparmakov <aia21@cam.ac.uk>,
	Al Viro <viro@ftp.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH resend] introduce I_SYNC
Date: Thu, 31 May 2007 13:06:03 -0500	[thread overview]
Message-ID: <1180634763.13932.28.camel@kleikamp.austin.ibm.com> (raw)
In-Reply-To: <20070531142535.GA25236@lazybastard.org>

On Thu, 2007-05-31 at 16:25 +0200, Jörn Engel wrote:
> --- linux-2.6.21logfs/fs/jfs/jfs_txnmgr.c~I_LOCK        2007-05-07
> 10:28:55.000000000 +0200
> +++ linux-2.6.21logfs/fs/jfs/jfs_txnmgr.c       2007-05-29
> 13:10:32.000000000 +0200
> @@ -1286,7 +1286,14 @@ int txCommit(tid_t tid,          /*
> transaction 
>                  * commit the transaction synchronously, so the last
> iput
>                  * will be done by the calling thread (or later)
>                  */
> -               if (tblk->u.ip->i_state & I_LOCK)
> +               /*
> +                * I believe this code is no longer needed.  Splitting
> I_LOCK
> +                * into two bits, I_LOCK and I_SYNC should prevent
> this
> +                * deadlock as well.  But since I don't have a JFS
> testload
> +                * to verify this, only a trivial s/I_LOCK/I_SYNC/ was
> done.
> +                * Joern
> +                */
> +               if (tblk->u.ip->i_state & I_SYNC)
>                         tblk->xflag &= ~COMMIT_LAZY;
>         }

I think the code is still needed, and I think this change is correct.
The deadlock that this code is avoiding is caused by clear_inode()
calling wait_on_inode().  Since clear_inode() now calls
inode_sync_wait(inode), we want to avoid the lazily committing this
transaction when the I_SYNC flag is set.

Unfortunately, recreating the deadlock is hard, and I haven't been able
to recreate it with this code commented out.

Thanks,
Shaggy
-- 
David Kleikamp
IBM Linux Technology Center

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2007-05-31 18:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-16 17:01 [PATCH resend] introduce I_SYNC Jörn Engel
2007-05-16 17:15 ` Andrew Morton
2007-05-16 17:47   ` Jörn Engel
2007-05-31 14:25   ` Jörn Engel
2007-05-31 18:06     ` Dave Kleikamp [this message]
2007-05-31 22:46     ` Andrew Morton
2007-06-01 12:00       ` Jörn Engel
2007-06-01  8:59 ` Anton Altaparmakov
2007-06-01 11:56   ` Jörn Engel

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=1180634763.13932.28.camel@kleikamp.austin.ibm.com \
    --to=shaggy@linux.vnet.ibm.com \
    --cc=aia21@cam.ac.uk \
    --cc=akpm@linux-foundation.org \
    --cc=dgc@sgi.com \
    --cc=hch@infradead.org \
    --cc=joern@lazybastard.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ftp.linux.org.uk \
    /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).