Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c51e0129
Commit
c51e0129
authored
Aug 12, 2016
by
Martin Brandenburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orangefs: do not allow client readahead cache without feature bit
Signed-off-by:
Martin Brandenburg
<
martin@omnibond.com
>
parent
482664dd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
+27
-5
fs/orangefs/file.c
fs/orangefs/file.c
+8
-5
fs/orangefs/orangefs-sysfs.c
fs/orangefs/orangefs-sysfs.c
+19
-0
No files found.
fs/orangefs/file.c
View file @
c51e0129
...
@@ -624,11 +624,14 @@ static int orangefs_file_release(struct inode *inode, struct file *file)
...
@@ -624,11 +624,14 @@ static int orangefs_file_release(struct inode *inode, struct file *file)
if
(
file
->
f_path
.
dentry
->
d_inode
&&
if
(
file
->
f_path
.
dentry
->
d_inode
&&
file
->
f_path
.
dentry
->
d_inode
->
i_mapping
&&
file
->
f_path
.
dentry
->
d_inode
->
i_mapping
&&
mapping_nrpages
(
&
file
->
f_path
.
dentry
->
d_inode
->
i_data
))
{
mapping_nrpages
(
&
file
->
f_path
.
dentry
->
d_inode
->
i_data
))
{
if
(
orangefs_features
&
ORANGEFS_FEATURE_READAHEAD
)
{
gossip_debug
(
GOSSIP_INODE_DEBUG
,
gossip_debug
(
GOSSIP_INODE_DEBUG
,
"calling flush_racache on %pU
\n
"
,
"calling flush_racache on %pU
\n
"
,
get_khandle_from_ino
(
inode
));
get_khandle_from_ino
(
inode
));
flush_racache
(
inode
);
flush_racache
(
inode
);
gossip_debug
(
GOSSIP_INODE_DEBUG
,
"flush_racache finished
\n
"
);
gossip_debug
(
GOSSIP_INODE_DEBUG
,
"flush_racache finished
\n
"
);
}
truncate_inode_pages
(
file
->
f_path
.
dentry
->
d_inode
->
i_mapping
,
truncate_inode_pages
(
file
->
f_path
.
dentry
->
d_inode
->
i_mapping
,
0
);
0
);
}
}
...
...
fs/orangefs/orangefs-sysfs.c
View file @
c51e0129
...
@@ -842,6 +842,16 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
...
@@ -842,6 +842,16 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
if
(
!
strcmp
(
kobj_id
,
ORANGEFS_KOBJ_ID
))
{
if
(
!
strcmp
(
kobj_id
,
ORANGEFS_KOBJ_ID
))
{
orangefs_attr
=
(
struct
orangefs_attribute
*
)
attr
;
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
(
!
strcmp
(
orangefs_attr
->
attr
.
name
,
"perf_history_size"
))
new_op
->
upcall
.
req
.
param
.
op
=
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE
;
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)
...
@@ -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
))
{
if
(
!
strcmp
(
kobj_id
,
ORANGEFS_KOBJ_ID
))
{
orangefs_attr
=
(
struct
orangefs_attribute
*
)
attr
;
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
(
!
strcmp
(
orangefs_attr
->
attr
.
name
,
"perf_history_size"
))
{
if
(
val
>
0
)
{
if
(
val
>
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment