aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-25 18:02:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-25 18:02:10 -0500
commitcb4195535f22162295eeb4a7909056843e65d367 (patch)
tree6839f6d1d38690782f3dace736c56b1f5d41893e
parent9003ed1fed2a3fe2774a6b67dcbe1ab31d7f8ec3 (diff)
parente98bdb3059cbf2b1cd4261e126b08429f64466c3 (diff)
Merge tag 'for-linus-4.11-ofs2' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux
Pull orangefs updates from Mike Marshall: "Orangefs: cleanups, a protocol fix and an added configuration button. Cleanups: - silence harmless integer overflow warning (from dan.carpenter@oracle.com) - Dan Carpenter influenced debugfs cleanups. - remove orangefs_backing_dev_info (from jack@suse.cz) Protocol fix: - fix buffer size mis-match between kernel space and user space New configuration button: - support readahead_readcnt parameter" * tag 'for-linus-4.11-ofs2' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: fix buffer size mis-match between kernel space and user space. orangefs: Dan Carpenter influenced cleanups... orangefs: Remove orangefs_backing_dev_info orangefs: Support readahead_readcnt parameter. orangefs: silence harmless integer overflow warning
-rw-r--r--fs/orangefs/devorangefs-req.c5
-rw-r--r--fs/orangefs/inode.c6
-rw-r--r--fs/orangefs/orangefs-bufmap.c5
-rw-r--r--fs/orangefs/orangefs-debugfs.c15
-rw-r--r--fs/orangefs/orangefs-dev-proto.h3
-rw-r--r--fs/orangefs/orangefs-kernel.h1
-rw-r--r--fs/orangefs/orangefs-mod.c12
-rw-r--r--fs/orangefs/orangefs-sysfs.c32
-rw-r--r--fs/orangefs/upcall.h1
9 files changed, 49 insertions, 31 deletions
diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index b0ced669427e..c4ab6fdf17a0 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -400,8 +400,9 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
400 /* remove the op from the in progress hash table */ 400 /* remove the op from the in progress hash table */
401 op = orangefs_devreq_remove_op(head.tag); 401 op = orangefs_devreq_remove_op(head.tag);
402 if (!op) { 402 if (!op) {
403 gossip_err("WARNING: No one's waiting for tag %llu\n", 403 gossip_debug(GOSSIP_DEV_DEBUG,
404 llu(head.tag)); 404 "%s: No one's waiting for tag %llu\n",
405 __func__, llu(head.tag));
405 return ret; 406 return ret;
406 } 407 }
407 408
diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index 551bc74ed2b8..5cd617980fbf 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -136,12 +136,6 @@ static ssize_t orangefs_direct_IO(struct kiocb *iocb,
136 return -EINVAL; 136 return -EINVAL;
137} 137}
138 138
139struct backing_dev_info orangefs_backing_dev_info = {
140 .name = "orangefs",
141 .ra_pages = 0,
142 .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK,
143};
144
145/** ORANGEFS2 implementation of address space operations */ 139/** ORANGEFS2 implementation of address space operations */
146const struct address_space_operations orangefs_address_operations = { 140const struct address_space_operations orangefs_address_operations = {
147 .readpage = orangefs_readpage, 141 .readpage = orangefs_readpage,
diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c
index 75375e90a63f..6333cbbdfef7 100644
--- a/fs/orangefs/orangefs-bufmap.c
+++ b/fs/orangefs/orangefs-bufmap.c
@@ -344,6 +344,11 @@ int orangefs_bufmap_initialize(struct ORANGEFS_dev_map_desc *user_desc)
344 user_desc->size, 344 user_desc->size,
345 user_desc->count); 345 user_desc->count);
346 346
347 if (user_desc->total_size < 0 ||
348 user_desc->size < 0 ||
349 user_desc->count < 0)
350 goto out;
351
347 /* 352 /*
348 * sanity check alignment and size of buffer that caller wants to 353 * sanity check alignment and size of buffer that caller wants to
349 * work with 354 * work with
diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c
index 27e75cf28b3a..791912da97d7 100644
--- a/fs/orangefs/orangefs-debugfs.c
+++ b/fs/orangefs/orangefs-debugfs.c
@@ -967,13 +967,13 @@ int orangefs_debugfs_new_client_string(void __user *arg)
967 int ret; 967 int ret;
968 968
969 ret = copy_from_user(&client_debug_array_string, 969 ret = copy_from_user(&client_debug_array_string,
970 (void __user *)arg, 970 (void __user *)arg,
971 ORANGEFS_MAX_DEBUG_STRING_LEN); 971 ORANGEFS_MAX_DEBUG_STRING_LEN);
972 972
973 if (ret != 0) { 973 if (ret != 0) {
974 pr_info("%s: CLIENT_STRING: copy_from_user failed\n", 974 pr_info("%s: CLIENT_STRING: copy_from_user failed\n",
975 __func__); 975 __func__);
976 return -EIO; 976 return -EFAULT;
977 } 977 }
978 978
979 /* 979 /*
@@ -988,17 +988,18 @@ int orangefs_debugfs_new_client_string(void __user *arg)
988 */ 988 */
989 client_debug_array_string[ORANGEFS_MAX_DEBUG_STRING_LEN - 1] = 989 client_debug_array_string[ORANGEFS_MAX_DEBUG_STRING_LEN - 1] =
990 '\0'; 990 '\0';
991 991
992 pr_info("%s: client debug array string has been received.\n", 992 pr_info("%s: client debug array string has been received.\n",
993 __func__); 993 __func__);
994 994
995 if (!help_string_initialized) { 995 if (!help_string_initialized) {
996 996
997 /* Build a proper debug help string. */ 997 /* Build a proper debug help string. */
998 if (orangefs_prepare_debugfs_help_string(0)) { 998 ret = orangefs_prepare_debugfs_help_string(0);
999 if (ret) {
999 gossip_err("%s: no debug help string \n", 1000 gossip_err("%s: no debug help string \n",
1000 __func__); 1001 __func__);
1001 return -EIO; 1002 return ret;
1002 } 1003 }
1003 1004
1004 } 1005 }
@@ -1011,7 +1012,7 @@ int orangefs_debugfs_new_client_string(void __user *arg)
1011 1012
1012 help_string_initialized++; 1013 help_string_initialized++;
1013 1014
1014 return ret; 1015 return 0;
1015} 1016}
1016 1017
1017int orangefs_debugfs_new_debug(void __user *arg) 1018int orangefs_debugfs_new_debug(void __user *arg)
diff --git a/fs/orangefs/orangefs-dev-proto.h b/fs/orangefs/orangefs-dev-proto.h
index a3d84ffee905..f380f9ed1b28 100644
--- a/fs/orangefs/orangefs-dev-proto.h
+++ b/fs/orangefs/orangefs-dev-proto.h
@@ -50,8 +50,7 @@
50 * Misc constants. Please retain them as multiples of 8! 50 * Misc constants. Please retain them as multiples of 8!
51 * Otherwise 32-64 bit interactions will be messed up :) 51 * Otherwise 32-64 bit interactions will be messed up :)
52 */ 52 */
53#define ORANGEFS_MAX_DEBUG_STRING_LEN 0x00000400 53#define ORANGEFS_MAX_DEBUG_STRING_LEN 0x00000800
54#define ORANGEFS_MAX_DEBUG_ARRAY_LEN 0x00000800
55 54
56/* 55/*
57 * The maximum number of directory entries in a single request is 96. 56 * The maximum number of directory entries in a single request is 96.
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h
index 3bf803d732c5..70355a9a2596 100644
--- a/fs/orangefs/orangefs-kernel.h
+++ b/fs/orangefs/orangefs-kernel.h
@@ -529,7 +529,6 @@ extern spinlock_t orangefs_htable_ops_in_progress_lock;
529extern int hash_table_size; 529extern int hash_table_size;
530 530
531extern const struct address_space_operations orangefs_address_operations; 531extern const struct address_space_operations orangefs_address_operations;
532extern struct backing_dev_info orangefs_backing_dev_info;
533extern const struct inode_operations orangefs_file_inode_operations; 532extern const struct inode_operations orangefs_file_inode_operations;
534extern const struct file_operations orangefs_file_operations; 533extern const struct file_operations orangefs_file_operations;
535extern const struct inode_operations orangefs_symlink_inode_operations; 534extern const struct inode_operations orangefs_symlink_inode_operations;
diff --git a/fs/orangefs/orangefs-mod.c b/fs/orangefs/orangefs-mod.c
index 4113eb0495bf..c1b5174cb5a9 100644
--- a/fs/orangefs/orangefs-mod.c
+++ b/fs/orangefs/orangefs-mod.c
@@ -80,11 +80,6 @@ static int __init orangefs_init(void)
80 int ret = -1; 80 int ret = -1;
81 __u32 i = 0; 81 __u32 i = 0;
82 82
83 ret = bdi_init(&orangefs_backing_dev_info);
84
85 if (ret)
86 return ret;
87
88 if (op_timeout_secs < 0) 83 if (op_timeout_secs < 0)
89 op_timeout_secs = 0; 84 op_timeout_secs = 0;
90 85
@@ -94,7 +89,7 @@ static int __init orangefs_init(void)
94 /* initialize global book keeping data structures */ 89 /* initialize global book keeping data structures */
95 ret = op_cache_initialize(); 90 ret = op_cache_initialize();
96 if (ret < 0) 91 if (ret < 0)
97 goto err; 92 goto out;
98 93
99 ret = orangefs_inode_cache_initialize(); 94 ret = orangefs_inode_cache_initialize();
100 if (ret < 0) 95 if (ret < 0)
@@ -181,9 +176,6 @@ cleanup_inode:
181cleanup_op: 176cleanup_op:
182 op_cache_finalize(); 177 op_cache_finalize();
183 178
184err:
185 bdi_destroy(&orangefs_backing_dev_info);
186
187out: 179out:
188 return ret; 180 return ret;
189} 181}
@@ -207,8 +199,6 @@ static void __exit orangefs_exit(void)
207 199
208 kfree(orangefs_htable_ops_in_progress); 200 kfree(orangefs_htable_ops_in_progress);
209 201
210 bdi_destroy(&orangefs_backing_dev_info);
211
212 pr_info("orangefs: module version %s unloaded\n", ORANGEFS_VERSION); 202 pr_info("orangefs: module version %s unloaded\n", ORANGEFS_VERSION);
213} 203}
214 204
diff --git a/fs/orangefs/orangefs-sysfs.c b/fs/orangefs/orangefs-sysfs.c
index 084954448f18..afd2f523b283 100644
--- a/fs/orangefs/orangefs-sysfs.c
+++ b/fs/orangefs/orangefs-sysfs.c
@@ -91,6 +91,13 @@
91 * Description: 91 * Description:
92 * Readahead cache buffer count and size. 92 * Readahead cache buffer count and size.
93 * 93 *
94 * What: /sys/fs/orangefs/readahead_readcnt
95 * Date: Jan 2017
96 * Contact: Martin Brandenburg <martin@omnibond.com>
97 * Description:
98 * Number of buffers (in multiples of readahead_size)
99 * which can be read ahead for a single file at once.
100 *
94 * What: /sys/fs/orangefs/acache/... 101 * What: /sys/fs/orangefs/acache/...
95 * Date: Jun 2015 102 * Date: Jun 2015
96 * Contact: Martin Brandenburg <martin@omnibond.com> 103 * Contact: Martin Brandenburg <martin@omnibond.com>
@@ -329,7 +336,8 @@ static ssize_t sysfs_service_op_show(struct kobject *kobj,
329 if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) && 336 if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
330 (!strcmp(attr->attr.name, "readahead_count") || 337 (!strcmp(attr->attr.name, "readahead_count") ||
331 !strcmp(attr->attr.name, "readahead_size") || 338 !strcmp(attr->attr.name, "readahead_size") ||
332 !strcmp(attr->attr.name, "readahead_count_size"))) { 339 !strcmp(attr->attr.name, "readahead_count_size") ||
340 !strcmp(attr->attr.name, "readahead_readcnt"))) {
333 rc = -EINVAL; 341 rc = -EINVAL;
334 goto out; 342 goto out;
335 } 343 }
@@ -360,6 +368,11 @@ static ssize_t sysfs_service_op_show(struct kobject *kobj,
360 "readahead_count_size")) 368 "readahead_count_size"))
361 new_op->upcall.req.param.op = 369 new_op->upcall.req.param.op =
362 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE; 370 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE;
371
372 else if (!strcmp(attr->attr.name,
373 "readahead_readcnt"))
374 new_op->upcall.req.param.op =
375 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT;
363 } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) { 376 } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {
364 if (!strcmp(attr->attr.name, "timeout_msecs")) 377 if (!strcmp(attr->attr.name, "timeout_msecs"))
365 new_op->upcall.req.param.op = 378 new_op->upcall.req.param.op =
@@ -542,7 +555,8 @@ static ssize_t sysfs_service_op_store(struct kobject *kobj,
542 if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) && 555 if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
543 (!strcmp(attr->attr.name, "readahead_count") || 556 (!strcmp(attr->attr.name, "readahead_count") ||
544 !strcmp(attr->attr.name, "readahead_size") || 557 !strcmp(attr->attr.name, "readahead_size") ||
545 !strcmp(attr->attr.name, "readahead_count_size"))) { 558 !strcmp(attr->attr.name, "readahead_count_size") ||
559 !strcmp(attr->attr.name, "readahead_readcnt"))) {
546 rc = -EINVAL; 560 rc = -EINVAL;
547 goto out; 561 goto out;
548 } 562 }
@@ -609,6 +623,15 @@ static ssize_t sysfs_service_op_store(struct kobject *kobj,
609 new_op->upcall.req.param.u.value32[0] = val1; 623 new_op->upcall.req.param.u.value32[0] = val1;
610 new_op->upcall.req.param.u.value32[1] = val2; 624 new_op->upcall.req.param.u.value32[1] = val2;
611 goto value_set; 625 goto value_set;
626 } else if (!strcmp(attr->attr.name,
627 "readahead_readcnt")) {
628 if ((val >= 0)) {
629 new_op->upcall.req.param.op =
630 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT;
631 } else {
632 rc = 0;
633 goto out;
634 }
612 } 635 }
613 636
614 } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) { 637 } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {
@@ -812,6 +835,10 @@ static struct orangefs_attribute readahead_count_size_attribute =
812 __ATTR(readahead_count_size, 0664, sysfs_service_op_show, 835 __ATTR(readahead_count_size, 0664, sysfs_service_op_show,
813 sysfs_service_op_store); 836 sysfs_service_op_store);
814 837
838static struct orangefs_attribute readahead_readcnt_attribute =
839 __ATTR(readahead_readcnt, 0664, sysfs_service_op_show,
840 sysfs_service_op_store);
841
815static struct orangefs_attribute perf_counter_reset_attribute = 842static struct orangefs_attribute perf_counter_reset_attribute =
816 __ATTR(perf_counter_reset, 843 __ATTR(perf_counter_reset,
817 0664, 844 0664,
@@ -838,6 +865,7 @@ static struct attribute *orangefs_default_attrs[] = {
838 &readahead_count_attribute.attr, 865 &readahead_count_attribute.attr,
839 &readahead_size_attribute.attr, 866 &readahead_size_attribute.attr,
840 &readahead_count_size_attribute.attr, 867 &readahead_count_size_attribute.attr,
868 &readahead_readcnt_attribute.attr,
841 &perf_counter_reset_attribute.attr, 869 &perf_counter_reset_attribute.attr,
842 &perf_history_size_attribute.attr, 870 &perf_history_size_attribute.attr,
843 &perf_time_interval_secs_attribute.attr, 871 &perf_time_interval_secs_attribute.attr,
diff --git a/fs/orangefs/upcall.h b/fs/orangefs/upcall.h
index af0b0e36d559..b8249f8fdd80 100644
--- a/fs/orangefs/upcall.h
+++ b/fs/orangefs/upcall.h
@@ -182,6 +182,7 @@ enum orangefs_param_request_op {
182 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE = 26, 182 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE = 26,
183 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT = 27, 183 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT = 27,
184 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE = 28, 184 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE = 28,
185 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT = 29,
185}; 186};
186 187
187struct orangefs_param_request_s { 188struct orangefs_param_request_s {