mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
fuse: fix llseek bug
The test in fuse_file_llseek() "not SEEK_CUR or not SEEK_SET" always evaluates to true. This was introduced in 3.1 by commit 06222e49 (fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek) and changed the behavior of SEEK_CUR and SEEK_SET to always retrieve the file attributes. This is a performance regression. Fix the test so that it makes sense. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: stable@vger.kernel.org CC: Josef Bacik <josef@redhat.com> CC: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
48706d0a91
commit
b48c6af208
@ -1556,7 +1556,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
|
||||
mutex_lock(&inode->i_mutex);
|
||||
if (origin != SEEK_CUR || origin != SEEK_SET) {
|
||||
if (origin != SEEK_CUR && origin != SEEK_SET) {
|
||||
retval = fuse_update_attributes(inode, NULL, file, NULL);
|
||||
if (retval)
|
||||
goto exit;
|
||||
|
Loading…
x
Reference in New Issue
Block a user