Messages in this thread | | | Date | Wed, 6 Jul 2005 14:41:14 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH] NFS: fix client hang due to race condition |
| |
Nick Wilson <njw@osdl.org> wrote: > > The flags field in struct nfs_inode is protected by the BKL. This patch > fixes a couple places where the lock is not obtained before changing the > flags. >
Yeah, nasty. Well caught.
> } > invalidate_inode_pages2(mapping); > + lock_kernel(); > nfsi->flags &= ~NFS_INO_INVALID_DATA; > + unlock_kernel();
Adding new lock_kernel()s is a bit retro. We might want to use a per-inode lock for this, or set_bit/clear_bit and friends.
If we choose to use a per-inode lock then it is legal to use inode.i_lock (coz I said) as long as no locks are nested inside it. i_lock's mandate is "a general-purpose innermost per-inode lock". - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |