diff options
author | Martin Brandenburg <martin@omnibond.com> | 2016-08-12 16:12:09 -0400 |
---|---|---|
committer | Martin Brandenburg <martin@omnibond.com> | 2016-08-12 16:12:09 -0400 |
commit | c51e012942a7594f59db5611db14fa4a29624a10 (patch) | |
tree | 04387368dd9e27b999c14c8e292235ac40b106a4 /fs/orangefs/file.c | |
parent | 482664ddba81b3a5404fd083bb9697dfffc0b6a4 (diff) | |
download | linux-stable-c51e012942a7594f59db5611db14fa4a29624a10.tar.gz linux-stable-c51e012942a7594f59db5611db14fa4a29624a10.tar.bz2 linux-stable-c51e012942a7594f59db5611db14fa4a29624a10.zip |
orangefs: do not allow client readahead cache without feature bit
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Diffstat (limited to 'fs/orangefs/file.c')
-rw-r--r-- | fs/orangefs/file.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 43c08b5c7168..fe5e1eac9561 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -624,11 +624,14 @@ static int orangefs_file_release(struct inode *inode, struct file *file) if (file->f_path.dentry->d_inode && file->f_path.dentry->d_inode->i_mapping && mapping_nrpages(&file->f_path.dentry->d_inode->i_data)) { - gossip_debug(GOSSIP_INODE_DEBUG, - "calling flush_racache on %pU\n", - get_khandle_from_ino(inode)); - flush_racache(inode); - gossip_debug(GOSSIP_INODE_DEBUG, "flush_racache finished\n"); + if (orangefs_features & ORANGEFS_FEATURE_READAHEAD) { + gossip_debug(GOSSIP_INODE_DEBUG, + "calling flush_racache on %pU\n", + get_khandle_from_ino(inode)); + flush_racache(inode); + gossip_debug(GOSSIP_INODE_DEBUG, + "flush_racache finished\n"); + } truncate_inode_pages(file->f_path.dentry->d_inode->i_mapping, 0); } |