Skip to contentSkip to conversation

vfs: add missing unlock in sget()

PATCH New Li Zefan 1 participant 1 message Feb 10, 2009 VFS

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 vfs: add missing unlock in sget()

In sget(), destroy_super(s) is called with s->s_umount held, which makes lockdep unhappy.

---
 fs/super.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
fs/super.c +4 -1
index 61dce00..f849485 100644
@@ -356,8 +356,10 @@ retry:
 				continue;
 			if (!grab_super(old))
 				goto retry;
-			if (s)
+			if (s) {
+				up_write(&s->s_umount);
 				destroy_super(s);
+			}
 			return old;
 		}
 	}
@@ -372,6 +374,7 @@ retry:
 	err = set(s, data);
 	if (err) {
 		spin_unlock(&sb_lock);
+		up_write(&s->s_umount);
 		destroy_super(s);
 		return ERR_PTR(err);
 	}
Signature · 1 line
1.5.4.rc3