Re: [PATCH] NFS: fix client hang due to race condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nick Wilson <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux