From: green@linuxhacker.ru
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org,
Andreas Dilger <andreas.dilger@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Oleg Drokin <green@linuxhacker.ru>
Subject: [PATCH 1/2] staging/lustre/llite: remove LL_IOC_REMOVE_ENTRY handler
Date: Wed, 10 Jun 2015 00:41:22 -0400 [thread overview]
Message-ID: <1433911283-24902-2-git-send-email-green@linuxhacker.ru> (raw)
In-Reply-To: <1433911283-24902-1-git-send-email-green@linuxhacker.ru>
From: Oleg Drokin <green@linuxhacker.ru>
It uses getname in unsafe manner and since it's to deal with corrupted
or inconsistent filesystem, we are probably better to deal with
it from lfsck anyway.
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
drivers/staging/lustre/lustre/llite/dir.c | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 4b0de8d..87a042c 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -1436,35 +1436,6 @@ free_lmv:
kfree(tmp);
return rc;
}
- case LL_IOC_REMOVE_ENTRY: {
- char *filename = NULL;
- int namelen = 0;
- int rc;
-
- /* Here is a little hack to avoid sending REINT_RMENTRY to
- * unsupported server, which might crash the server(LU-2730),
- * Because both LVB_TYPE and REINT_RMENTRY will be supported
- * on 2.4, we use OBD_CONNECT_LVB_TYPE to detect whether the
- * server will support REINT_RMENTRY XXX*/
- if (!(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_LVB_TYPE))
- return -ENOTSUPP;
-
- filename = ll_getname((const char *)arg);
- if (IS_ERR(filename))
- return PTR_ERR(filename);
-
- namelen = strlen(filename);
- if (namelen < 1) {
- rc = -EINVAL;
- goto out_rmdir;
- }
-
- rc = ll_rmdir_entry(inode, filename, namelen);
-out_rmdir:
- if (filename)
- ll_putname(filename);
- return rc;
- }
case LL_IOC_LOV_SWAP_LAYOUTS:
return -EPERM;
case LL_IOC_OBD_STATFS:
--
2.1.0
next prev parent reply other threads:[~2015-06-10 4:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 4:41 [PATCH 0/2] Fixup lusre ll_getname green
2015-06-10 4:41 ` green [this message]
2015-06-10 7:08 ` [PATCH 1/2] staging/lustre/llite: remove LL_IOC_REMOVE_ENTRY handler Sudip Mukherjee
2015-06-10 7:19 ` Oleg Drokin
2015-06-10 4:41 ` [PATCH 2/2] staging/lustre/llite: fix ll_getname user buffer copy green
2015-06-10 7:52 ` Dan Carpenter
2015-06-10 7:59 ` Oleg Drokin
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=1433911283-24902-2-git-send-email-green@linuxhacker.ru \
--to=green@linuxhacker.ru \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--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