Skip to contentSkip to conversation

fs: mntput might sleep

RFC PATCH In review Nick Piggin 3 participants 3 messages Mar 17, 2010 – Mar 18, 2010 VFS

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 fs: mntput might sleep

I missed this once or twice, so can we put might_sleep check into mntput? Or does anyone call it from atomic context to drop a known not-last reference? (if so then maybe the caller could be rewritten). --

include/linux/mount.h +2 -0
Index: linux-2.6/include/linux/mount.h
===================================================================
@@ -113,6 +113,8 @@ extern int __mnt_is_readonly(struct vfsm
 static inline void mntput(struct vfsmount *mnt)
 {
 	if (mnt) {
+		might_sleep();
+
 		mnt->mnt_expiry_mark = 0;
 		mntput_no_expire(mnt);
 	}
#1 lore raw
Quoted 9 lines · Nick Piggin

I missed this once or twice, so can we put might_sleep check into mntput? Or does anyone call it from atomic context to drop a known not-last reference? (if so then maybe the caller could be rewritten). --
Index: linux-2.6/include/linux/mount.h
===================================================================

include/linux/mount.h extern int __mnt_is_readonly(struct vfsm · line 120

Quoted 8 lines
include/linux/mount.h +2 -0
@@ -113,6 +113,8 @@ extern int __mnt_is_readonly(struct vfsm
 static inline void mntput(struct vfsmount *mnt)
 {
 	if (mnt) {
+		might_sleep();
+
 		mnt->mnt_expiry_mark = 0;
 		mntput_no_expire(mnt);
 	}

None of my union mount tests trigger it, fine by me. :)

-VAL

maintainer
#2 lore raw
In reply to Nick Piggin
Quoted 3 lines · Nick Piggin

I missed this once or twice, so can we put might_sleep check into mntput? Or does anyone call it from atomic context to drop a known not-last reference? (if so then maybe the caller could be rewritten).

There are places where it's called for known non-last reference under interesting locks. I'm not sure if vfsmount_lock is one of those, but...