Store the set of open O_XXX flags as part of the referenced file-handle
to allow more verbose debug-logging info upon close. This should ease
the developer's logging analysis where same inode is opened multiple
times but with different flags set.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15703
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit
341ff48a5a787ed358a28037b5ec751b7b530e20)
struct Fh *fh;
struct dirent *de;
int fd;
+ int o_flags;
};
static int cephmount_next_fd(struct cephmount_cached *cme)
int ret = 0;
if (cfh->fh != NULL) {
- DBG_DEBUG("[ceph] ceph_ll_close: fd=%d\n", cfh->fd);
+ DBG_DEBUG("[ceph] ceph_ll_close: fd=%d o_flags=0x%x\n",
+ cfh->fd, cfh->o_flags);
ret = cfh->config->ceph_ll_close_fn(cfh->cme->mount, cfh->fh);
cfh->fh = NULL;
}
cfh->iref.ino = (long)stx.stx_ino;
cfh->iref.owner = true;
cfh->fh = fh;
+ cfh->o_flags = oflags;
vfs_ceph_assign_fh_fd(cfh);
return 0;
cfh->uperm);
if (ret == 0) {
cfh->fh = fh;
+ cfh->o_flags = flags;
vfs_ceph_assign_fh_fd(cfh);
}
return ret;
* Cephfs' Inode* from the above lookup so there is no
* need to go via expensive ceph_ll_open for Fh*.
*/
+ cfh->o_flags = flags;
vfs_ceph_assign_fh_fd(cfh);
result = cfh->fd;
goto out;