Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+49 -31
+3 -2
fs/orangefs/devorangefs-req.c
··· 400 400 /* remove the op from the in progress hash table */ 401 401 op = orangefs_devreq_remove_op(head.tag); 402 402 if (!op) { 403 - gossip_err("WARNING: No one's waiting for tag %llu\n", 404 - llu(head.tag)); 403 + gossip_debug(GOSSIP_DEV_DEBUG, 404 + "%s: No one's waiting for tag %llu\n", 405 + __func__, llu(head.tag)); 405 406 return ret; 406 407 } 407 408
-6
fs/orangefs/inode.c
··· 136 136 return -EINVAL; 137 137 } 138 138 139 - struct 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 139 /** ORANGEFS2 implementation of address space operations */ 146 140 const struct address_space_operations orangefs_address_operations = { 147 141 .readpage = orangefs_readpage,
+5
fs/orangefs/orangefs-bufmap.c
··· 344 344 user_desc->size, 345 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 353 * sanity check alignment and size of buffer that caller wants to 349 354 * work with
+8 -7
fs/orangefs/orangefs-debugfs.c
··· 967 967 int ret; 968 968 969 969 ret = copy_from_user(&client_debug_array_string, 970 - (void __user *)arg, 971 - ORANGEFS_MAX_DEBUG_STRING_LEN); 970 + (void __user *)arg, 971 + ORANGEFS_MAX_DEBUG_STRING_LEN); 972 972 973 973 if (ret != 0) { 974 974 pr_info("%s: CLIENT_STRING: copy_from_user failed\n", 975 975 __func__); 976 - return -EIO; 976 + return -EFAULT; 977 977 } 978 978 979 979 /* ··· 988 988 */ 989 989 client_debug_array_string[ORANGEFS_MAX_DEBUG_STRING_LEN - 1] = 990 990 '\0'; 991 - 991 + 992 992 pr_info("%s: client debug array string has been received.\n", 993 993 __func__); 994 994 995 995 if (!help_string_initialized) { 996 996 997 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 1000 gossip_err("%s: no debug help string \n", 1000 1001 __func__); 1001 - return -EIO; 1002 + return ret; 1002 1003 } 1003 1004 1004 1005 } ··· 1012 1011 1013 1012 help_string_initialized++; 1014 1013 1015 - return ret; 1014 + return 0; 1016 1015 } 1017 1016 1018 1017 int orangefs_debugfs_new_debug(void __user *arg)
+1 -2
fs/orangefs/orangefs-dev-proto.h
··· 50 50 * Misc constants. Please retain them as multiples of 8! 51 51 * Otherwise 32-64 bit interactions will be messed up :) 52 52 */ 53 - #define ORANGEFS_MAX_DEBUG_STRING_LEN 0x00000400 54 - #define ORANGEFS_MAX_DEBUG_ARRAY_LEN 0x00000800 53 + #define ORANGEFS_MAX_DEBUG_STRING_LEN 0x00000800 55 54 56 55 /* 57 56 * The maximum number of directory entries in a single request is 96.
-1
fs/orangefs/orangefs-kernel.h
··· 529 529 extern int hash_table_size; 530 530 531 531 extern const struct address_space_operations orangefs_address_operations; 532 - extern struct backing_dev_info orangefs_backing_dev_info; 533 532 extern const struct inode_operations orangefs_file_inode_operations; 534 533 extern const struct file_operations orangefs_file_operations; 535 534 extern const struct inode_operations orangefs_symlink_inode_operations;
+1 -11
fs/orangefs/orangefs-mod.c
··· 80 80 int ret = -1; 81 81 __u32 i = 0; 82 82 83 - ret = bdi_init(&orangefs_backing_dev_info); 84 - 85 - if (ret) 86 - return ret; 87 - 88 83 if (op_timeout_secs < 0) 89 84 op_timeout_secs = 0; 90 85 ··· 89 94 /* initialize global book keeping data structures */ 90 95 ret = op_cache_initialize(); 91 96 if (ret < 0) 92 - goto err; 97 + goto out; 93 98 94 99 ret = orangefs_inode_cache_initialize(); 95 100 if (ret < 0) ··· 176 181 cleanup_op: 177 182 op_cache_finalize(); 178 183 179 - err: 180 - bdi_destroy(&orangefs_backing_dev_info); 181 - 182 184 out: 183 185 return ret; 184 186 } ··· 198 206 op_cache_finalize(); 199 207 200 208 kfree(orangefs_htable_ops_in_progress); 201 - 202 - bdi_destroy(&orangefs_backing_dev_info); 203 209 204 210 pr_info("orangefs: module version %s unloaded\n", ORANGEFS_VERSION); 205 211 }
+30 -2
fs/orangefs/orangefs-sysfs.c
··· 91 91 * Description: 92 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 101 * What: /sys/fs/orangefs/acache/... 95 102 * Date: Jun 2015 96 103 * Contact: Martin Brandenburg <martin@omnibond.com> ··· 336 329 if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) && 337 330 (!strcmp(attr->attr.name, "readahead_count") || 338 331 !strcmp(attr->attr.name, "readahead_size") || 339 - !strcmp(attr->attr.name, "readahead_count_size"))) { 332 + !strcmp(attr->attr.name, "readahead_count_size") || 333 + !strcmp(attr->attr.name, "readahead_readcnt"))) { 340 334 rc = -EINVAL; 341 335 goto out; 342 336 } ··· 368 360 "readahead_count_size")) 369 361 new_op->upcall.req.param.op = 370 362 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE; 363 + 364 + else if (!strcmp(attr->attr.name, 365 + "readahead_readcnt")) 366 + new_op->upcall.req.param.op = 367 + ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT; 371 368 } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) { 372 369 if (!strcmp(attr->attr.name, "timeout_msecs")) 373 370 new_op->upcall.req.param.op = ··· 555 542 if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) && 556 543 (!strcmp(attr->attr.name, "readahead_count") || 557 544 !strcmp(attr->attr.name, "readahead_size") || 558 - !strcmp(attr->attr.name, "readahead_count_size"))) { 545 + !strcmp(attr->attr.name, "readahead_count_size") || 546 + !strcmp(attr->attr.name, "readahead_readcnt"))) { 559 547 rc = -EINVAL; 560 548 goto out; 561 549 } ··· 623 609 new_op->upcall.req.param.u.value32[0] = val1; 624 610 new_op->upcall.req.param.u.value32[1] = val2; 625 611 goto value_set; 612 + } else if (!strcmp(attr->attr.name, 613 + "readahead_readcnt")) { 614 + if ((val >= 0)) { 615 + new_op->upcall.req.param.op = 616 + ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT; 617 + } else { 618 + rc = 0; 619 + goto out; 620 + } 626 621 } 627 622 628 623 } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) { ··· 835 812 __ATTR(readahead_count_size, 0664, sysfs_service_op_show, 836 813 sysfs_service_op_store); 837 814 815 + static struct orangefs_attribute readahead_readcnt_attribute = 816 + __ATTR(readahead_readcnt, 0664, sysfs_service_op_show, 817 + sysfs_service_op_store); 818 + 838 819 static struct orangefs_attribute perf_counter_reset_attribute = 839 820 __ATTR(perf_counter_reset, 840 821 0664, ··· 865 838 &readahead_count_attribute.attr, 866 839 &readahead_size_attribute.attr, 867 840 &readahead_count_size_attribute.attr, 841 + &readahead_readcnt_attribute.attr, 868 842 &perf_counter_reset_attribute.attr, 869 843 &perf_history_size_attribute.attr, 870 844 &perf_time_interval_secs_attribute.attr,
+1
fs/orangefs/upcall.h
··· 182 182 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE = 26, 183 183 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT = 27, 184 184 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE = 28, 185 + ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT = 29, 185 186 }; 186 187 187 188 struct orangefs_param_request_s {