On 16/10/06 16:51 -0700, Andrew Morton wrote:
On Mon, 16 Oct 2006 18:27:10 +0200 Miklos Szeredi <[email protected]> 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: [email protected] AIM: ncmikeday Yahoo: ultra.runner PGP key: http://www.ncultra.org/ncmike/pubkey.asc
Attachment:
signature.asc
Description: Digital signature
- Follow-Ups:
- Re: fuse: fix hang on SMP
- From: Miklos Szeredi <[email protected]>
- Re: fuse: fix hang on SMP
- References:
- [patch 00/12] fuse update
- From: Miklos Szeredi <[email protected]>
- [patch 01/12] fuse: fix hang on SMP
- From: Miklos Szeredi <[email protected]>
- Re: [patch 01/12] fuse: fix hang on SMP
- From: Andrew Morton <[email protected]>
- [patch 00/12] fuse update
- Prev by Date: Re: [PATCH] Fix typos in doc and comments (1)
- Next by Date: [PATCH] backlight users need to select BACKLIGHT_CLASS_DEVICE
- Previous by thread: Re: [patch 01/12] fuse: fix hang on SMP
- Next by thread: Re: fuse: fix hang on SMP
- Index(es):