[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Mon Feb 13 20:05:02 UTC 2023
The branch, master has been updated
via 54a8da86407 vfs_ceph: use fsp_get_pathref_fd in ceph fstatat and close vfs calls
from 58cdcce582d Add gitleaks configuration file to avoid false positives
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 54a8da864071e28eb6297b872dcb57fb9b171f33
Author: John Mulligan <jmulligan at redhat.com>
Date: Fri Feb 3 13:09:18 2023 -0500
vfs_ceph: use fsp_get_pathref_fd in ceph fstatat and close vfs calls
Replace fsp_get_io_fd with fsp_get_pathref_fd as these calls do use
pathref fsps. fsp_get_io_fd asserts that the fsp is not pathref and
asserts (on a debug build) or returns -1 (non debug build).
Prior to these changes running ls on the root of the share failed.
Logging from the failure case:
```
openat_pathref_fsp: smb_fname [.]
openat_pathref_fullname: smb_fname [.]
fsp_new: allocated files structure (1 used)
file_name_hash: //. hash 0x3dfcc1c2
check_reduced_name: check_reduced_name [.] [/]
cephwrap_realpath: [CEPH] realpath(0x55604da9a030, .) = //.
check_reduced_name realpath [.] -> [//.]
check_reduced_name: . reduced to //.
cephwrap_openat: [CEPH] openat(0x55604da9a030, ., 0x55604da81f00, 133120, 0)
cephwrap_openat: [CEPH] open(...) = 10
cephwrap_fstat: fsp_get_io_fd: fsp [.] is a path referencing fsp
[CEPH] fstat(0x55604da9a030, -1)
fsp_get_io_fd: fsp [.] is a path referencing fsp
cephwrap_fstat: [CEPH] fstat(...) = -9
fd_openat: name ., flags = 04000 mode = 00, fd = 10. NT_STATUS_INVALID_HANDLE
openat_pathref_fullname: Opening pathref for [.] failed: NT_STATUS_INVALID_HANDLE
```
This change also seems to match the recommendations in the `When to use
fsp_get_io_fd() or fsp_get_pathref_fd()` section of The_New_VFS.txt
document.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15307
Signed-off-by: John Mulligan <jmulligan at redhat.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Gunther Deschner <gdeschne at redhat.com>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Mon Feb 13 20:04:38 UTC 2023 on atb-devel-224
-----------------------------------------------------------------------
Summary of changes:
source3/modules/vfs_ceph.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index b8190fa25e4..c5ee9d5967c 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -464,7 +464,7 @@ static int cephwrap_close(struct vfs_handle_struct *handle, files_struct *fsp)
int result;
DBG_DEBUG("[CEPH] close(%p, %p)\n", handle, fsp);
- result = ceph_close(handle->data, fsp_get_io_fd(fsp));
+ result = ceph_close(handle->data, fsp_get_pathref_fd(fsp));
DBG_DEBUG("[CEPH] close(...) = %d\n", result);
WRAP_RETURN(result);
@@ -788,9 +788,10 @@ static int cephwrap_fstat(struct vfs_handle_struct *handle, files_struct *fsp, S
{
int result = -1;
struct ceph_statx stx;
+ int fd = fsp_get_pathref_fd(fsp);
- DBG_DEBUG("[CEPH] fstat(%p, %d)\n", handle, fsp_get_io_fd(fsp));
- result = ceph_fstatx(handle->data, fsp_get_io_fd(fsp), &stx,
+ DBG_DEBUG("[CEPH] fstat(%p, %d)\n", handle, fd);
+ result = ceph_fstatx(handle->data, fd, &stx,
SAMBA_STATX_ATTR_MASK, 0);
DBG_DEBUG("[CEPH] fstat(...) = %d\n", result);
if (result < 0) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list