[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1185384502.6585.97.camel@localhost>
Date: Wed, 25 Jul 2007 13:28:22 -0400
From: Trond Myklebust <trond.myklebust@....uio.no>
To: Christian Krafft <krafft@...ibm.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [patch] nfs: fix locking in nfs/inode.c in
nfs_free_open_context
On Wed, 2007-07-25 at 17:08 +0200, Christian Krafft wrote:
> Obviously the locking code in nfs_free_open_context is wrong.
> Checking the list for entries and removing the entry should be an atomic operation.
Wrong. It is quite safe to test the structure member ctx->list for
emptiness outside the spinlock because we have an explicit guarantee
that nobody else has a reference to this structure, plus the
atomic_dec_and_test() in kref_put() has acted as a memory barrier for
us.
> Also list_del_init should be used, because list_del will leave the empty list in
> an undefined condition.
Huh? We're freeing the context. It will _never_ _ever_ _ever_ be used
again. If anything tries to use ctx->list after this, then that is a
major bug.
Patch rejected...
Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists