Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-9280 osd-zfs: don't mark existing on failed creation
[fs/lustre-release.git]
/
lustre
/
fld
/
lproc_fld.c
diff --git
a/lustre/fld/lproc_fld.c
b/lustre/fld/lproc_fld.c
index
d915dcd
..
c7be5bf
100644
(file)
--- a/
lustre/fld/lproc_fld.c
+++ b/
lustre/fld/lproc_fld.c
@@
-15,11
+15,7
@@
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
*
* GPL HEADER END
*/
@@
-27,7
+23,7
@@
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, 201
3
, Intel Corporation.
+ * Copyright (c) 2012, 201
6
, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
@@
-51,7
+47,7
@@
#include <lustre_fid.h>
#include "fld_internal.h"
#include <lustre_fid.h>
#include "fld_internal.h"
-#ifdef
LPROC
FS
+#ifdef
CONFIG_PROC_
FS
static int
fld_proc_targets_seq_show(struct seq_file *m, void *unused)
{
static int
fld_proc_targets_seq_show(struct seq_file *m, void *unused)
{
@@
-87,22
+83,29
@@
static ssize_t
fld_proc_hash_seq_write(struct file *file, const char __user *buffer,
size_t count, loff_t *off)
{
fld_proc_hash_seq_write(struct file *file, const char __user *buffer,
size_t count, loff_t *off)
{
- struct lu_client_fld *fld
= ((struct seq_file *)file->private_data)->private
;
-
struct lu_fld_hash *hash = NULL;
-
int i
;
-
ENTRY
;
+ struct lu_client_fld *fld;
+ struct lu_fld_hash *hash = NULL;
+
char fh_name[8]
;
+
int i
;
- LASSERT(fld != NULL);
+ if (count > sizeof(fh_name))
+ return -ENAMETOOLONG;
- for (i = 0; fld_hash[i].fh_name != NULL; i++) {
- if (count != strlen(fld_hash[i].fh_name))
- continue;
+ if (copy_from_user(fh_name, buffer, count) != 0)
+ return -EFAULT;
- if (!strncmp(fld_hash[i].fh_name, buffer, count)) {
- hash = &fld_hash[i];
- break;
- }
- }
+ fld = ((struct seq_file *)file->private_data)->private;
+ LASSERT(fld != NULL);
+
+ for (i = 0; fld_hash[i].fh_name != NULL; i++) {
+ if (count != strlen(fld_hash[i].fh_name))
+ continue;
+
+ if (!strncmp(fld_hash[i].fh_name, fh_name, count)) {
+ hash = &fld_hash[i];
+ break;
+ }
+ }
if (hash != NULL) {
spin_lock(&fld->lcf_lock);
if (hash != NULL) {
spin_lock(&fld->lcf_lock);
@@
-113,7
+116,7
@@
fld_proc_hash_seq_write(struct file *file, const char __user *buffer,
fld->lcf_name, hash->fh_name);
}
fld->lcf_name, hash->fh_name);
}
-
RETURN(count)
;
+
return count
;
}
static ssize_t
}
static ssize_t
@@
-256,7
+259,7
@@
static int fldb_seq_show(struct seq_file *p, void *v)
fld->lsf_name, rc);
} else if (fld_rec->lsr_start != 0) {
range_be_to_cpu(fld_rec, fld_rec);
fld->lsf_name, rc);
} else if (fld_rec->lsr_start != 0) {
range_be_to_cpu(fld_rec, fld_rec);
-
rc =
seq_printf(p, DRANGE"\n", PRANGE(fld_rec));
+ seq_printf(p, DRANGE"\n", PRANGE(fld_rec));
}
return rc;
}
return rc;
@@
-279,7
+282,10
@@
static int fldb_seq_open(struct inode *inode, struct file *file)
int env_init = 0;
int rc;
int env_init = 0;
int rc;
- LPROCFS_ENTRY_CHECK(PDE(inode));
+ rc = LPROCFS_ENTRY_CHECK(inode);
+ if (rc < 0)
+ return rc;
+
rc = seq_open(file, &fldb_sops);
if (rc)
GOTO(out, rc);
rc = seq_open(file, &fldb_sops);
if (rc)
GOTO(out, rc);
@@
-301,7
+307,7
@@
static int fldb_seq_open(struct inode *inode, struct file *file)
env_init = 1;
iops = &obj->do_index_ops->dio_it;
env_init = 1;
iops = &obj->do_index_ops->dio_it;
- param->fsp_it = iops->init(¶m->fsp_env, obj, 0
, NULL
);
+ param->fsp_it = iops->init(¶m->fsp_env, obj, 0);
if (IS_ERR(param->fsp_it))
GOTO(out, rc = PTR_ERR(param->fsp_it));
if (IS_ERR(param->fsp_it))
GOTO(out, rc = PTR_ERR(param->fsp_it));
@@
-362,4
+368,4
@@
struct lprocfs_vars fld_server_proc_list[] = {
# endif /* HAVE_SERVER_SUPPORT */
# endif /* HAVE_SERVER_SUPPORT */
-#endif /*
LPROC
FS */
+#endif /*
CONFIG_PROC_
FS */