Skip to contentSkip to conversation

a couple of fixes

GIT PULL Al Viro 2 participants 2 messages Sep 28, 2012 VFS

lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

A couple of fixes; one for automount/lazy umount race, another
a classic "we don't protect the refcount transition to zero with the lock that protects looking for object in hash" kind of crap in lockd. Please, pull. The usual place - git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for-linus

Shortlog:
Al Viro (2):
do_add_mount()/umount -l races
close the race in nlmsvc_free_block()

Diffstat:

 fs/lockd/svclock.c |    3 +--
 fs/namespace.c     |   10 ++++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)
#1 lore raw

Hmm. What is the status of the rename_lock write-lock recursion deadlock patch from Miklos?

Attached is a simpler version of it (Miklos, can you verify this simplified version also works for you?), but it's still fairly ugly.

Linus

 fs/dcache.c | 6 ++++++
 1 file changed, 6 insertions(+)
fs/dcache.c +6 -0
index 0364af2311f4..693f95bf1cae 100644
@@ -1134,6 +1134,8 @@ positive:
 	return 1;
 
 rename_retry:
+	if (locked)
+		goto again;
 	locked = 1;
 	write_seqlock(&rename_lock);
 	goto again;
@@ -1236,6 +1238,8 @@ out:
 rename_retry:
 	if (found)
 		return found;
+	if (locked)
+		goto again;
 	locked = 1;
 	write_seqlock(&rename_lock);
 	goto again;
@@ -3035,6 +3039,8 @@ resume:
 	return;
 
 rename_retry:
+	if (locked)
+		goto again;
 	locked = 1;
 	write_seqlock(&rename_lock);
 	goto again;