summaryrefslogtreecommitdiffstats
path: root/fs/orangefs/orangefs-sysfs.c
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2016-09-28 20:47:29 +0200
committerMartin Brandenburg <martin@omnibond.com>2016-09-28 20:47:29 +0200
commitf808e138c0abd99bfce90ec8d4ef6406c2af714a (patch)
treebe66f4beb9de1b2fecbf1e59950fe714184c8ecb /fs/orangefs/orangefs-sysfs.c
parentMerge tag 'for-hubcap-v4.9-readahead' of git://github.com/martinbrandenburg/l... (diff)
parentorangefs: bump minimum userspace version (diff)
downloadlinux-f808e138c0abd99bfce90ec8d4ef6406c2af714a.tar.xz
linux-f808e138c0abd99bfce90ec8d4ef6406c2af714a.zip
Merge branch 'features' into for-next
Pull in an OrangeFS branch containing improvements which the userspace component and the kernel to negotiate mutually supported features.
Diffstat (limited to 'fs/orangefs/orangefs-sysfs.c')
-rw-r--r--fs/orangefs/orangefs-sysfs.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/orangefs/orangefs-sysfs.c b/fs/orangefs/orangefs-sysfs.c
index 2fe9a3a2117b..ed5ee33d0f7e 100644
--- a/fs/orangefs/orangefs-sysfs.c
+++ b/fs/orangefs/orangefs-sysfs.c
@@ -842,6 +842,16 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) {
orangefs_attr = (struct orangefs_attribute *)attr;
+ /* Drop unsupported requests first. */
+ if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
+ (!strcmp(orangefs_attr->attr.name, "readahead_count") ||
+ !strcmp(orangefs_attr->attr.name, "readahead_size") ||
+ !strcmp(orangefs_attr->attr.name,
+ "readahead_count_size"))) {
+ rc = -EINVAL;
+ goto out;
+ }
+
if (!strcmp(orangefs_attr->attr.name, "perf_history_size"))
new_op->upcall.req.param.op =
ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE;
@@ -1133,6 +1143,15 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) {
orangefs_attr = (struct orangefs_attribute *)attr;
+ /* Drop unsupported requests first. */
+ if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
+ (!strcmp(orangefs_attr->attr.name, "readahead_count") ||
+ !strcmp(orangefs_attr->attr.name, "readahead_size") ||
+ !strcmp(orangefs_attr->attr.name,
+ "readahead_count_size"))) {
+ rc = -EINVAL;
+ goto out;
+ }
if (!strcmp(orangefs_attr->attr.name, "perf_history_size")) {
if (val > 0) {