"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xlators/storage/posix/src/posix-inode-fd-ops.c" between
glusterfs-8.4.tar.gz and glusterfs-8.5.tar.gz

About: GlusterFS is a network/cluster filesystem. The storage server (or each in a cluster) runs glusterfsd and the clients use mount command or glusterfs client to mount the exported filesystem. Release series 8.x.

posix-inode-fd-ops.c  (glusterfs-8.4):posix-inode-fd-ops.c  (glusterfs-8.5)
skipping to change at line 57 skipping to change at line 57
#include <glusterfs/statedump.h> #include <glusterfs/statedump.h>
#include <glusterfs/locking.h> #include <glusterfs/locking.h>
#include <glusterfs/timer.h> #include <glusterfs/timer.h>
#include "glusterfs3-xdr.h" #include "glusterfs3-xdr.h"
#include <glusterfs/glusterfs-acl.h> #include <glusterfs/glusterfs-acl.h>
#include "posix-messages.h" #include "posix-messages.h"
#include "posix-metadata.h" #include "posix-metadata.h"
#include <glusterfs/events.h> #include <glusterfs/events.h>
#include "posix-gfid-path.h" #include "posix-gfid-path.h"
#include <glusterfs/compat-uuid.h> #include <glusterfs/compat-uuid.h>
#include <glusterfs/common-utils.h>
extern char *marker_xattrs[]; extern char *marker_xattrs[];
#define ALIGN_SIZE 4096 #define ALIGN_SIZE 4096
#undef HAVE_SET_FSID #undef HAVE_SET_FSID
#ifdef HAVE_SET_FSID #ifdef HAVE_SET_FSID
#define DECLARE_OLD_FS_ID_VAR \ #define DECLARE_OLD_FS_ID_VAR \
uid_t old_fsuid; \ uid_t old_fsuid; \
gid_t old_fsgid; gid_t old_fsgid;
skipping to change at line 2718 skipping to change at line 2719
{ {
int32_t op_ret = -1; int32_t op_ret = -1;
int32_t op_errno = 0; int32_t op_errno = 0;
char *real_path = NULL; char *real_path = NULL;
char *acl_xattr = NULL; char *acl_xattr = NULL;
struct iatt preop = {0}; struct iatt preop = {0};
struct iatt postop = {0}; struct iatt postop = {0};
int32_t ret = 0; int32_t ret = 0;
ssize_t acl_size = 0; ssize_t acl_size = 0;
dict_t *xattr = NULL; dict_t *xattr = NULL;
dict_t *subvol_xattrs = NULL;
posix_xattr_filler_t filler = { posix_xattr_filler_t filler = {
0, 0,
}; };
struct posix_private *priv = NULL; struct posix_private *priv = NULL;
struct iatt tmp_stbuf = { struct iatt tmp_stbuf = {
0, 0,
}; };
data_t *tdata = NULL; data_t *tdata = NULL;
char *cs_var = NULL; char *cs_var = NULL;
gf_cs_obj_state state = -1; gf_cs_obj_state state = -1;
int i = 0; int i = 0;
int len; int len;
struct mdata_iatt mdata_iatt = { struct mdata_iatt mdata_iatt = {
0, 0,
}; };
int8_t sync_backend_xattrs = _gf_false;
data_pair_t *custom_xattrs;
data_t *keyval = NULL;
char **xattrs_to_heal = get_xattrs_to_heal();
DECLARE_OLD_FS_ID_VAR; DECLARE_OLD_FS_ID_VAR;
SET_FS_ID(frame->root->uid, frame->root->gid); SET_FS_ID(frame->root->uid, frame->root->gid);
VALIDATE_OR_GOTO(frame, out); VALIDATE_OR_GOTO(frame, out);
VALIDATE_OR_GOTO(this, out); VALIDATE_OR_GOTO(this, out);
VALIDATE_OR_GOTO(this->private, out); VALIDATE_OR_GOTO(this->private, out);
VALIDATE_OR_GOTO(loc, out); VALIDATE_OR_GOTO(loc, out);
VALIDATE_OR_GOTO(dict, out); VALIDATE_OR_GOTO(dict, out);
skipping to change at line 2915 skipping to change at line 2921
#else #else
filler.flags = flags; filler.flags = flags;
#endif #endif
op_ret = dict_foreach(dict, _handle_setxattr_keyvalue_pair, &filler); op_ret = dict_foreach(dict, _handle_setxattr_keyvalue_pair, &filler);
if (op_ret < 0) { if (op_ret < 0) {
op_errno = -op_ret; op_errno = -op_ret;
op_ret = -1; op_ret = -1;
goto out; goto out;
} }
if (xdata) {
ret = dict_get_int8(xdata, "sync_backend_xattrs", &sync_backend_xattrs);
if (ret) {
gf_msg_debug(this->name, -ret, "Unable to get sync_backend_xattrs");
}
}
if (sync_backend_xattrs) {
/* List all custom xattrs */
subvol_xattrs = dict_new();
if (!subvol_xattrs)
goto out;
ret = dict_set_int32_sizen(xdata, "list-xattr", 1);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0, ENOMEM,
"Unable to set list-xattr in dict ");
goto out;
}
subvol_xattrs = posix_xattr_fill(this, real_path, loc, NULL, -1, xdata,
NULL);
/* Remove all user xattrs from the file */
dict_foreach_fnmatch(subvol_xattrs, "user.*", posix_delete_user_xattr,
real_path);
/* Remove all custom xattrs from the file */
for (i = 1; xattrs_to_heal[i]; i++) {
keyval = dict_get(subvol_xattrs, xattrs_to_heal[i]);
if (keyval) {
ret = sys_lremovexattr(real_path, xattrs_to_heal[i]);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, P_MSG_XATTR_NOT_REMOVED,
errno, "removexattr failed. key %s path %s",
xattrs_to_heal[i], loc->path);
goto out;
}
dict_del(subvol_xattrs, xattrs_to_heal[i]);
keyval = NULL;
}
}
/* Set custom xattrs based on info provided by DHT */
custom_xattrs = dict->members_list;
while (custom_xattrs != NULL) {
ret = sys_lsetxattr(real_path, custom_xattrs->key,
custom_xattrs->value->data,
custom_xattrs->value->len, flags);
if (ret) {
op_errno = errno;
gf_log(this->name, GF_LOG_ERROR, "setxattr failed - %s %d",
custom_xattrs->key, ret);
goto out;
}
custom_xattrs = custom_xattrs->next;
}
}
xattr = dict_new(); xattr = dict_new();
if (!xattr) if (!xattr)
goto out; goto out;
/* /*
* FIXFIX: Send the stbuf info in the xdata for now * FIXFIX: Send the stbuf info in the xdata for now
* This is used by DHT to redirect FOPs if the file is being migrated * This is used by DHT to redirect FOPs if the file is being migrated
* Ignore errors for now * Ignore errors for now
*/ */
ret = posix_pstat(this, loc->inode, loc->gfid, real_path, &postop, ret = posix_pstat(this, loc->inode, loc->gfid, real_path, &postop,
skipping to change at line 3022 skipping to change at line 3090
} }
out: out:
SET_TO_OLD_FS_ID(); SET_TO_OLD_FS_ID();
STACK_UNWIND_STRICT(setxattr, frame, op_ret, op_errno, xattr); STACK_UNWIND_STRICT(setxattr, frame, op_ret, op_errno, xattr);
if (xattr) if (xattr)
dict_unref(xattr); dict_unref(xattr);
if (subvol_xattrs)
dict_unref(subvol_xattrs);
return 0; return 0;
} }
int int
posix_xattr_get_real_filename(call_frame_t *frame, xlator_t *this, loc_t *loc, posix_xattr_get_real_filename(call_frame_t *frame, xlator_t *this, loc_t *loc,
const char *key, dict_t *dict, dict_t *xdata) const char *key, dict_t *dict, dict_t *xdata)
{ {
int ret = -1; int ret = -1;
int op_ret = -1; int op_ret = -1;
const char *fname = NULL; const char *fname = NULL;
skipping to change at line 5687 skipping to change at line 5758
if (!dir) { if (!dir) {
gf_msg(this->name, GF_LOG_WARNING, EINVAL, P_MSG_PFD_NULL, gf_msg(this->name, GF_LOG_WARNING, EINVAL, P_MSG_PFD_NULL,
"dir is NULL for fd=%p", fd); "dir is NULL for fd=%p", fd);
op_errno = EINVAL; op_errno = EINVAL;
goto out; goto out;
} }
/* When READDIR_FILTER option is set to on, we can filter out /* When READDIR_FILTER option is set to on, we can filter out
* directory's entry from the entry->list. * directory's entry from the entry->list.
*/ */
ret = dict_get_int32(dict, GF_READDIR_SKIP_DIRS, &skip_dirs); ret = dict_get_int32_sizen(dict, GF_READDIR_SKIP_DIRS, &skip_dirs);
LOCK(&fd->lock); LOCK(&fd->lock);
{ {
/* posix_fill_readdir performs multiple separate individual /* posix_fill_readdir performs multiple separate individual
readdir() calls to fill up the buffer. readdir() calls to fill up the buffer.
In case of NFS where the same anonymous FD is shared between In case of NFS where the same anonymous FD is shared between
different applications, reading a common directory can different applications, reading a common directory can
result in the anonymous fd getting re-used unsafely between result in the anonymous fd getting re-used unsafely between
the two readdir requests (in two different io-threads). the two readdir requests (in two different io-threads).
 End of changes. 6 change blocks. 
1 lines changed or deleted 72 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)