diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-02-16 20:25:19 -0500 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2016-03-25 22:30:54 -0400 |
commit | 177f8fc491e230c2e7a3ac7d5626dd6f3d94e9f2 (patch) | |
tree | 459a9dbb6a8a61ab18fd522d701eb6ad27f5b09d /fs/orangefs/file.c | |
parent | 7df240d771862c31f869d6b9024c1942c1f01521 (diff) | |
download | op-kernel-dev-177f8fc491e230c2e7a3ac7d5626dd6f3d94e9f2.zip op-kernel-dev-177f8fc491e230c2e7a3ac7d5626dd6f3d94e9f2.tar.gz |
orangefs: sanitize ->llseek()
a) open files can't have NULL inodes
b) it's SEEK_END, not ORANGEFS_SEEK_END; no need to get cute.
c) make_bad_inode() on lseek()?
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/file.c')
-rw-r--r-- | fs/orangefs/file.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 63e6a10..cb6a164 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -652,14 +652,9 @@ static int orangefs_fsync(struct file *file, static loff_t orangefs_file_llseek(struct file *file, loff_t offset, int origin) { int ret = -EINVAL; - struct inode *inode = file->f_path.dentry->d_inode; + struct inode *inode = file_inode(file); - if (!inode) { - gossip_err("orangefs_file_llseek: invalid inode (NULL)\n"); - return ret; - } - - if (origin == ORANGEFS_SEEK_END) { + if (origin == SEEK_END) { /* * revalidate the inode's file size. * NOTE: We are only interested in file size here, @@ -674,7 +669,6 @@ static loff_t orangefs_file_llseek(struct file *file, loff_t offset, int origin) __FILE__, __func__, __LINE__); - orangefs_make_bad_inode(inode); return ret; } } @@ -684,7 +678,7 @@ static loff_t orangefs_file_llseek(struct file *file, loff_t offset, int origin) " | inode size is %lu\n", (long)offset, origin, - (unsigned long)file->f_path.dentry->d_inode->i_size); + (unsigned long)i_size_read(inode)); return generic_file_llseek(file, offset, origin); } |