mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
vfs_fruit: fix close for fake_fd
If the next backend doesn't use kernel fd's should not pass a fake_fd to the next backend. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14596 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jan 8 21:38:18 UTC 2021 on sn-devel-184
This commit is contained in:
parent
c5da084229
commit
564b62a6f7
@ -1661,6 +1661,7 @@ static int fruit_openat(vfs_handle_struct *handle,
|
|||||||
static int fruit_close_meta(vfs_handle_struct *handle,
|
static int fruit_close_meta(vfs_handle_struct *handle,
|
||||||
files_struct *fsp)
|
files_struct *fsp)
|
||||||
{
|
{
|
||||||
|
struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
|
||||||
int ret;
|
int ret;
|
||||||
struct fruit_config_data *config = NULL;
|
struct fruit_config_data *config = NULL;
|
||||||
|
|
||||||
@ -1669,7 +1670,12 @@ static int fruit_close_meta(vfs_handle_struct *handle,
|
|||||||
|
|
||||||
switch (config->meta) {
|
switch (config->meta) {
|
||||||
case FRUIT_META_STREAM:
|
case FRUIT_META_STREAM:
|
||||||
ret = SMB_VFS_NEXT_CLOSE(handle, fsp);
|
if (fio->fake_fd) {
|
||||||
|
ret = vfs_fake_fd_close(fsp_get_pathref_fd(fsp));
|
||||||
|
fsp_set_fd(fsp, -1);
|
||||||
|
} else {
|
||||||
|
ret = SMB_VFS_NEXT_CLOSE(handle, fsp);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FRUIT_META_NETATALK:
|
case FRUIT_META_NETATALK:
|
||||||
@ -2465,9 +2471,9 @@ static ssize_t fruit_pwrite_meta_stream(vfs_handle_struct *handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fio->fake_fd) {
|
if (fio->fake_fd) {
|
||||||
int fd;
|
int fd = fsp_get_pathref_fd(fsp);
|
||||||
|
|
||||||
ret = SMB_VFS_NEXT_CLOSE(handle, fsp);
|
ret = vfs_fake_fd_close(fd);
|
||||||
fsp_set_fd(fsp, -1);
|
fsp_set_fd(fsp, -1);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
DBG_ERR("Close [%s] failed: %s\n",
|
DBG_ERR("Close [%s] failed: %s\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user