From: David Disseldorp Date: Mon, 4 Mar 2019 10:35:45 +0000 (+0100) Subject: vfs: drop lseek stat-open checks X-Git-Tag: talloc-2.2.0~209 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fc1a09baee4e1339c0fe20e47e24b6ea6c293ae;p=thirdparty%2Fsamba.git vfs: drop lseek stat-open checks b9e91d2a8e41a43d7ebb7d7eed807a7d8de9b329 added fd==-1 checks to the lseek() path to handle "stat opens". Current reply.c and smb2_ioctl_filesys.c callers do not invoke SMB_VFS_LSEEK() with stat-open fsp structs, so the fd==-1 checks can be removed from the VFS. Signed-off-by: David Disseldorp Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 67b8d139891..38ffe08887e 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -575,10 +575,7 @@ static off_t cephwrap_lseek(struct vfs_handle_struct *handle, files_struct *fsp, off_t result = 0; DBG_DEBUG("[CEPH] cephwrap_lseek\n"); - /* Cope with 'stat' file opens. */ - if (fsp->fh->fd != -1) { - result = ceph_lseek(handle->data, fsp->fh->fd, offset, whence); - } + result = ceph_lseek(handle->data, fsp->fh->fd, offset, whence); WRAP_RETURN(result); } diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index cb5537e096e..1ed2c810667 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -1025,10 +1025,7 @@ static off_t vfswrap_lseek(vfs_handle_struct *handle, files_struct *fsp, off_t o START_PROFILE(syscall_lseek); - /* Cope with 'stat' file opens. */ - if (fsp->fh->fd != -1) - result = lseek(fsp->fh->fd, offset, whence); - + result = lseek(fsp->fh->fd, offset, whence); /* * We want to maintain the fiction that we can seek * on a fifo for file system purposes. This allows