linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Seunghun Lee <waydi1@gmail.com>
To: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Seunghun Lee <waydi1@gmail.com>
Subject: [PATCH] vfs: remove redundant sanity check in do_mount
Date: Sat, 13 Sep 2014 00:53:32 +0900	[thread overview]
Message-ID: <1410537212-3153-1-git-send-email-waydi1@gmail.com> (raw)

In sys_mount, getname() checks dir_name.
So do_mount needn't check dir_name again.

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
---
 fs/namespace.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index bfd03c6..bf8a9af 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2553,11 +2553,6 @@ long do_mount(const char *dev_name, const char *dir_name,
 	if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
 		flags &= ~MS_MGC_MSK;
 
-	/* Basic sanity checks */
-
-	if (!dir_name || !*dir_name || !memchr(dir_name, 0, PAGE_SIZE))
-		return -EINVAL;
-
 	if (data_page)
 		((char *)data_page)[PAGE_SIZE - 1] = 0;
 
-- 
1.7.9.5

             reply	other threads:[~2014-09-12 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 15:53 Seunghun Lee [this message]
2014-09-12 16:28 ` [PATCH] vfs: remove redundant sanity check in do_mount Al Viro
2014-09-13  4:11   ` Seunghun Lee
2014-09-14 13:15 ` [PATCH] vfs: move getname() from callers to do_mount() Seunghun Lee
2014-09-14 13:36   ` Jeff Layton
2014-09-14 18:12   ` Al Viro
     [not found]     ` <CA+LGb9aaMpiotK7-NUv4hKcJHbuWQE=DC=p=90ZguWqn44qcTQ@mail.gmail.com>
2014-09-15  5:18       ` Al Viro
2014-09-15  5:26         ` Seunghun Lee

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=1410537212-3153-1-git-send-email-waydi1@gmail.com \
    --to=waydi1@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).