1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

vfs_btrfs: fix btrfs_fget_compression()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14790
RB: vfs_btrfs compression support broken

Reported-by: noel.kuntze@thermi.consulting

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

(cherry picked from commit ed35fce4fe48b1fa26854a7b4bb151b5c5fb6fc6)
This commit is contained in:
Ralph Boehme 2021-08-09 19:30:21 +02:00 committed by Jule Anger
parent a7b9904c90
commit 35d474c303

View File

@ -460,11 +460,12 @@ static NTSTATUS btrfs_fget_compression(struct vfs_handle_struct *handle,
const char *p = NULL;
int ret;
long flags = 0;
int fsp_fd = fsp_get_pathref_fd(fsp);
int fd = -1;
NTSTATUS status;
if (!fsp->fsp_flags.is_pathref) {
ret = ioctl(fd, FS_IOC_GETFLAGS, &flags);
ret = ioctl(fsp_fd, FS_IOC_GETFLAGS, &flags);
if (ret < 0) {
DBG_WARNING("FS_IOC_GETFLAGS failed: %s, fd %lld\n",
strerror(errno), (long long)fd);
@ -482,9 +483,7 @@ static NTSTATUS btrfs_fget_compression(struct vfs_handle_struct *handle,
return NT_STATUS_NOT_IMPLEMENTED;
}
fd = fsp_get_pathref_fd(fsp);
p = sys_proc_fd_path(fd, buf, sizeof(buf));
p = sys_proc_fd_path(fsp_fd, buf, sizeof(buf));
if (p == NULL) {
return NT_STATUS_NO_MEMORY;
}