diff options
author | Josef Bacik <josef@redhat.com> | 2011-07-18 19:21:38 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-21 02:47:58 +0200 |
commit | 06222e491e663dac939f04b125c9dc52126a75c4 (patch) | |
tree | 99636fd666c8148a5bf58ea4844263d4b3a36310 /fs/nfs | |
parent | Ext4: handle SEEK_HOLE/SEEK_DATA generically (diff) | |
download | linux-06222e491e663dac939f04b125c9dc52126a75c4.tar.xz linux-06222e491e663dac939f04b125c9dc52126a75c4.zip |
fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
This converts everybody to handle SEEK_HOLE/SEEK_DATA properly. In some cases
we just return -EINVAL, in others we do the normal generic thing, and in others
we're simply making sure that the properly due-dilligence is done. For example
in NFS/CIFS we need to make sure the file size is update properly for the
SEEK_HOLE and SEEK_DATA case, but since it calls the generic llseek stuff itself
that is all we have to do. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/file.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 2f093ed16980..2c1705b6acd7 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -187,8 +187,11 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) filp->f_path.dentry->d_name.name, offset, origin); - /* origin == SEEK_END => we must revalidate the cached file length */ - if (origin == SEEK_END) { + /* + * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate + * the cached file length + */ + if (origin != SEEK_SET || origin != SEEK_CUR) { struct inode *inode = filp->f_mapping->host; int retval = nfs_revalidate_file_size(inode, filp); |