Skip to contentSkip to conversation

fs/namespace: waiting for mutex in lock_mount() is "killable"

PATCH New Max Kellermann 1 participant 1 message Dec 2, 2011 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/namespace: waiting for mutex in lock_mount() is "killable"

Allow killing the process while it's indirectly waiting for the NFS server's response.

---
 fs/namespace.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
fs/namespace.c +6 -1
index e5e1c7d..9560bec 100644
@@ -1651,8 +1651,13 @@ static int attach_recursive_mnt(struct vfsmount *source_mnt,
 static int lock_mount(struct path *path)
 {
 	struct vfsmount *mnt;
+	int err;
+
 retry:
-	mutex_lock(&path->dentry->d_inode->i_mutex);
+	err = mutex_lock_killable(&path->dentry->d_inode->i_mutex);
+	if (unlikely(err))
+		return err;
+
 	if (unlikely(cant_mount(path->dentry))) {
 		mutex_unlock(&path->dentry->d_inode->i_mutex);
 		return -ENOENT;