linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Day <ncmike@ncultra.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: fuse: fix hang on SMP
Date: Tue, 17 Oct 2006 08:53:50 -0400	[thread overview]
Message-ID: <20061017125350.GA22327@silverwood.ncultra.org> (raw)
In-Reply-To: <20061016165125.4605824b.akpm@osdl.org>

[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]

On 16/10/06 16:51 -0700, Andrew Morton wrote:
>On Mon, 16 Oct 2006 18:27:10 +0200
>Miklos Szeredi <miklos@szeredi.hu> wrote:
>
>> Fuse didn't always call i_size_write() with i_mutex held which caused
>> rare hangs on SMP/32bit.
>
>Yes, that is a bit of a trap.  I'll maintain a patch in -mm which spits a
>warning if i_size_write() is called without i_mutex held.
>

>+void i_size_write(struct inode *inode, loff_t i_size)
>+{
>+	WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex));


Miklos' patch would generate this warning because he uses the spinlock
inside struct fuse_conn to synchronize the write:

+static void fuse_vmtruncate(struct inode *inode, loff_t offset)
+{
+       struct fuse_conn *fc = get_fuse_conn(inode);
+       int need_trunc;
+
+       spin_lock(&fc->lock);
+       need_trunc = inode->i_size > offset;
+       i_size_write(inode, offset);
+       spin_unlock(&fc->lock);

-- 
Mike D. Day
IBM LTC
Cell: 919 412-3900
Sametime: ncmike@us.ibm.com AIM: ncmikeday  Yahoo: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

  reply	other threads:[~2006-10-17 12:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-16 16:27 [patch 00/12] fuse update Miklos Szeredi
2006-10-16 16:27 ` [patch 01/12] fuse: fix hang on SMP Miklos Szeredi
2006-10-16 23:51   ` Andrew Morton
2006-10-17 12:53     ` Mike Day [this message]
2006-10-17 13:43       ` Miklos Szeredi
2006-10-16 16:27 ` [patch 02/12] document i_size_write locking rules Miklos Szeredi
2006-10-16 16:27 ` [patch 03/12] fuse: locking fix for nlookup Miklos Szeredi
2006-10-16 16:27 ` [patch 04/12] fuse: fix spurious BUG Miklos Szeredi
2006-10-16 16:27 ` [patch 05/12] fuse: fix handling of moved directory Miklos Szeredi
2006-10-16 16:27 ` [patch 06/12] fuse: fix dereferencing dentry parent Miklos Szeredi
2006-10-16 16:27 ` [patch 07/12] fuse: update userspace interface to version 7.8 Miklos Szeredi
2006-10-16 16:27 ` [patch 08/12] fuse: minor cleanup in fuse_dentry_revalidate Miklos Szeredi
2006-10-16 16:27 ` [patch 09/12] fuse: add support for block device based filesystems Miklos Szeredi
2006-10-16 16:27 ` [patch 10/12] fuse: add blksize option Miklos Szeredi
2006-10-16 16:27 ` [patch 11/12] fuse: add bmap support Miklos Szeredi
2006-10-16 16:27 ` [patch 12/12] fuse: add DESTROY operation Miklos Szeredi

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=20061017125350.GA22327@silverwood.ncultra.org \
    --to=ncmike@ncultra.org \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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).