From: Max Kellermann <mk@cm4all.com>
To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: max@duempel.org
Subject: [PATCH] fs/namespace: waiting for mutex in lock_mount() is "killable"
Date: Fri, 02 Dec 2011 06:56:58 +0100 [thread overview]
Message-ID: <20111202055658.22371.21820.stgit@rabbit.intern.cm-ag> (raw)
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(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index e5e1c7d..9560bec 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -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;
reply other threads:[~2011-12-02 5:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111202055658.22371.21820.stgit@rabbit.intern.cm-ag \
--to=mk@cm4all.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=max@duempel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).