mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Nick Wilson <njw@osdl.org>
Cc: trond.myklebust@fys.uio.no, linux-kernel@vger.kernel.org,
	nfs@lists.sourceforge.net
Subject: Re: [PATCH] NFS: fix client hang due to race condition
Date: Wed, 6 Jul 2005 14:41:14 -0700	[thread overview]
Message-ID: <20050706144114.37bd05be.akpm@osdl.org> (raw)
In-Reply-To: <20050706212744.GC20698@njw.pdx.osdl.net>

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".

      reply	other threads:[~2005-07-06 21:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-06 21:27 Nick Wilson
2005-07-06 21:41 ` Andrew Morton [this message]

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=20050706144114.37bd05be.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=njw@osdl.org \
    --cc=trond.myklebust@fys.uio.no \
    /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

all inboxes | Powered by JetHome®