From: Jan Blunck <jblunck@suse.de>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: Linux-Kernel Mailinglist <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Subject: [patch 2/2] r/o bind mounts: Accept passing a mnt NULL pointer to mnt_drop_write()
Date: Fri, 12 Oct 2007 17:50:21 +0200 [thread overview]
Message-ID: <20071012155020.197228145@hasse.suse.de> (raw)
In-Reply-To: 20071012155019.747515889@hasse.suse.de
[-- Attachment #1: vfs/r-o-bind-mnt_drop_write-mnt-NULL-fix.diff --]
[-- Type: text/plain, Size: 613 bytes --]
In case of somebody opens a file with dentry_open(dentry, NULL, ...) we don't
want to stumble on the NULL pointer mnt in struct file.
Signed-off-by: Jan Blunck <jblunck@suse.de>
---
fs/namespace.c | 3 +++
1 file changed, 3 insertions(+)
Index: b/fs/namespace.c
===================================================================
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -253,6 +253,9 @@ void mnt_drop_write(struct vfsmount *mnt
int must_check_underflow = 0;
struct mnt_writer *cpu_writer;
+ if (!mnt)
+ return;
+
cpu_writer = &get_cpu_var(mnt_writers);
spin_lock(&cpu_writer->lock);
--
next prev parent reply other threads:[~2007-10-12 16:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-12 15:50 [patch 0/2] r/o bind mount fixes for 2.6.23-mm1 Jan Blunck
2007-10-12 15:50 ` [patch 1/2] r/o bind mounts: Dont touch the vfsmount after path_put() Jan Blunck
2007-10-12 16:06 ` Dave Hansen
2007-10-12 15:50 ` Jan Blunck [this message]
2007-10-12 16:10 ` [patch 2/2] r/o bind mounts: Accept passing a mnt NULL pointer to mnt_drop_write() Dave Hansen
2007-10-13 11:25 ` Christoph Hellwig
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=20071012155020.197228145@hasse.suse.de \
--to=jblunck@suse.de \
--cc=akpm@osdl.org \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.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