lkml.org 
[lkml]   [2005]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] namespace.c: fix race in mark_mounts_for_expiry()
On Fri, May 20, 2005 at 10:41:24AM +0200, Miklos Szeredi wrote:
> This patch fixes a race found by Ram in mark_mounts_for_expiry() in
> The solution is to make the atomic_read() and the get_namespace() into
> a single atomic operation. The patch does this in a fairly ugly way
> (see comment above fix), which should be safe regardless.

That it certainly is. What's more, there is a trivial way to deal with
that crap - have put_namespace() do atomic_dec_and_lock() instead of
atomic_dec_and_test(). And use the same spinlock (vfsmount_lock would be
an obvious choice) to protect the atomicity here. End of story.
-
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/

\
 
 \ /
  Last update: 2005-05-20 11:14    [W:0.043 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site