提交 cb419553 编写于 作者: L Linus Torvalds

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
......@@ -400,8 +400,9 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
/* remove the op from the in progress hash table */
op = orangefs_devreq_remove_op(head.tag);
if (!op) {
gossip_err("WARNING: No one's waiting for tag %llu\n",
llu(head.tag));
gossip_debug(GOSSIP_DEV_DEBUG,
"%s: No one's waiting for tag %llu\n",
__func__, llu(head.tag));
return ret;
}
......
......@@ -136,12 +136,6 @@ static ssize_t orangefs_direct_IO(struct kiocb *iocb,
return -EINVAL;
}
struct backing_dev_info orangefs_backing_dev_info = {
.name = "orangefs",
.ra_pages = 0,
.capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK,
};
/** ORANGEFS2 implementation of address space operations */
const struct address_space_operations orangefs_address_operations = {
.readpage = orangefs_readpage,
......
......@@ -344,6 +344,11 @@ int orangefs_bufmap_initialize(struct ORANGEFS_dev_map_desc *user_desc)
user_desc->size,
user_desc->count);
if (user_desc->total_size < 0 ||
user_desc->size < 0 ||
user_desc->count < 0)
goto out;
/*
* sanity check alignment and size of buffer that caller wants to
* work with
......
......@@ -967,13 +967,13 @@ int orangefs_debugfs_new_client_string(void __user *arg)
int ret;
ret = copy_from_user(&client_debug_array_string,
(void __user *)arg,
ORANGEFS_MAX_DEBUG_STRING_LEN);
(void __user *)arg,
ORANGEFS_MAX_DEBUG_STRING_LEN);
if (ret != 0) {
pr_info("%s: CLIENT_STRING: copy_from_user failed\n",
__func__);
return -EIO;
return -EFAULT;
}
/*
......@@ -988,17 +988,18 @@ int orangefs_debugfs_new_client_string(void __user *arg)
*/
client_debug_array_string[ORANGEFS_MAX_DEBUG_STRING_LEN - 1] =
'\0';
pr_info("%s: client debug array string has been received.\n",
__func__);
if (!help_string_initialized) {
/* Build a proper debug help string. */
if (orangefs_prepare_debugfs_help_string(0)) {
ret = orangefs_prepare_debugfs_help_string(0);
if (ret) {
gossip_err("%s: no debug help string \n",
__func__);
return -EIO;
return ret;
}
}
......@@ -1011,7 +1012,7 @@ int orangefs_debugfs_new_client_string(void __user *arg)
help_string_initialized++;
return ret;
return 0;
}
int orangefs_debugfs_new_debug(void __user *arg)
......
......@@ -50,8 +50,7 @@
* Misc constants. Please retain them as multiples of 8!
* Otherwise 32-64 bit interactions will be messed up :)
*/
#define ORANGEFS_MAX_DEBUG_STRING_LEN 0x00000400
#define ORANGEFS_MAX_DEBUG_ARRAY_LEN 0x00000800
#define ORANGEFS_MAX_DEBUG_STRING_LEN 0x00000800
/*
* The maximum number of directory entries in a single request is 96.
......
......@@ -529,7 +529,6 @@ extern spinlock_t orangefs_htable_ops_in_progress_lock;
extern int hash_table_size;
extern const struct address_space_operations orangefs_address_operations;
extern struct backing_dev_info orangefs_backing_dev_info;
extern const struct inode_operations orangefs_file_inode_operations;
extern const struct file_operations orangefs_file_operations;
extern const struct inode_operations orangefs_symlink_inode_operations;
......
......@@ -80,11 +80,6 @@ static int __init orangefs_init(void)
int ret = -1;
__u32 i = 0;
ret = bdi_init(&orangefs_backing_dev_info);
if (ret)
return ret;
if (op_timeout_secs < 0)
op_timeout_secs = 0;
......@@ -94,7 +89,7 @@ static int __init orangefs_init(void)
/* initialize global book keeping data structures */
ret = op_cache_initialize();
if (ret < 0)
goto err;
goto out;
ret = orangefs_inode_cache_initialize();
if (ret < 0)
......@@ -181,9 +176,6 @@ static int __init orangefs_init(void)
cleanup_op:
op_cache_finalize();
err:
bdi_destroy(&orangefs_backing_dev_info);
out:
return ret;
}
......@@ -207,8 +199,6 @@ static void __exit orangefs_exit(void)
kfree(orangefs_htable_ops_in_progress);
bdi_destroy(&orangefs_backing_dev_info);
pr_info("orangefs: module version %s unloaded\n", ORANGEFS_VERSION);
}
......
......@@ -91,6 +91,13 @@
* Description:
* Readahead cache buffer count and size.
*
* What: /sys/fs/orangefs/readahead_readcnt
* Date: Jan 2017
* Contact: Martin Brandenburg <martin@omnibond.com>
* Description:
* Number of buffers (in multiples of readahead_size)
* which can be read ahead for a single file at once.
*
* What: /sys/fs/orangefs/acache/...
* Date: Jun 2015
* Contact: Martin Brandenburg <martin@omnibond.com>
......@@ -329,7 +336,8 @@ static ssize_t sysfs_service_op_show(struct kobject *kobj,
if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
(!strcmp(attr->attr.name, "readahead_count") ||
!strcmp(attr->attr.name, "readahead_size") ||
!strcmp(attr->attr.name, "readahead_count_size"))) {
!strcmp(attr->attr.name, "readahead_count_size") ||
!strcmp(attr->attr.name, "readahead_readcnt"))) {
rc = -EINVAL;
goto out;
}
......@@ -360,6 +368,11 @@ static ssize_t sysfs_service_op_show(struct kobject *kobj,
"readahead_count_size"))
new_op->upcall.req.param.op =
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE;
else if (!strcmp(attr->attr.name,
"readahead_readcnt"))
new_op->upcall.req.param.op =
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT;
} else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {
if (!strcmp(attr->attr.name, "timeout_msecs"))
new_op->upcall.req.param.op =
......@@ -542,7 +555,8 @@ static ssize_t sysfs_service_op_store(struct kobject *kobj,
if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
(!strcmp(attr->attr.name, "readahead_count") ||
!strcmp(attr->attr.name, "readahead_size") ||
!strcmp(attr->attr.name, "readahead_count_size"))) {
!strcmp(attr->attr.name, "readahead_count_size") ||
!strcmp(attr->attr.name, "readahead_readcnt"))) {
rc = -EINVAL;
goto out;
}
......@@ -609,6 +623,15 @@ static ssize_t sysfs_service_op_store(struct kobject *kobj,
new_op->upcall.req.param.u.value32[0] = val1;
new_op->upcall.req.param.u.value32[1] = val2;
goto value_set;
} else if (!strcmp(attr->attr.name,
"readahead_readcnt")) {
if ((val >= 0)) {
new_op->upcall.req.param.op =
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT;
} else {
rc = 0;
goto out;
}
}
} else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {
......@@ -812,6 +835,10 @@ static struct orangefs_attribute readahead_count_size_attribute =
__ATTR(readahead_count_size, 0664, sysfs_service_op_show,
sysfs_service_op_store);
static struct orangefs_attribute readahead_readcnt_attribute =
__ATTR(readahead_readcnt, 0664, sysfs_service_op_show,
sysfs_service_op_store);
static struct orangefs_attribute perf_counter_reset_attribute =
__ATTR(perf_counter_reset,
0664,
......@@ -838,6 +865,7 @@ static struct attribute *orangefs_default_attrs[] = {
&readahead_count_attribute.attr,
&readahead_size_attribute.attr,
&readahead_count_size_attribute.attr,
&readahead_readcnt_attribute.attr,
&perf_counter_reset_attribute.attr,
&perf_history_size_attribute.attr,
&perf_time_interval_secs_attribute.attr,
......
......@@ -182,6 +182,7 @@ enum orangefs_param_request_op {
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE = 26,
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT = 27,
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE = 28,
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT = 29,
};
struct orangefs_param_request_s {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册