summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-07-13 00:37:25 +0000
committerAnand Avati <avati@gluster.com>2011-07-12 23:34:18 -0700
commit7c4ad6d3321cc440590a6132b7dc8d0d0a58ce3b (patch)
tree6ee6b53e9ae46d5bbbe2d4e7a648ce570765ef34 /xlators/storage/posix/src/posix.c
parent8b57a5c2fb16f2c85c0f74edbe7b841a6dc4a265 (diff)
storage/posix: set all keys present in 'params' dict while creating an entry
so, there is no need to do a 'setxattr()' after entry creation, which could now fail due to ACL on server side. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3164 (set xattr keys while entry creation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3164
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index d2cd79a753c..fd97980072f 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -827,6 +827,13 @@ posix_mknod (call_frame_t *frame, xlator_t *this,
strerror (errno));
}
+ op_ret = posix_entry_create_xattr_set (this, real_path, params);
+ if (op_ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "setting xattrs on %s failed (%s)", loc->path,
+ strerror (errno));
+ }
+
op_ret = posix_lstat_with_gfid (this, real_path, &stbuf);
if (op_ret == -1) {
op_errno = errno;
@@ -953,6 +960,13 @@ posix_mkdir (call_frame_t *frame, xlator_t *this,
strerror (errno));
}
+ op_ret = posix_entry_create_xattr_set (this, real_path, params);
+ if (op_ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "setting xattrs on %s failed (%s)", loc->path,
+ strerror (errno));
+ }
+
op_ret = posix_lstat_with_gfid (this, real_path, &stbuf);
if (op_ret == -1) {
op_errno = errno;
@@ -1265,6 +1279,13 @@ posix_symlink (call_frame_t *frame, xlator_t *this,
strerror (errno));
}
+ op_ret = posix_entry_create_xattr_set (this, real_path, params);
+ if (op_ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "setting xattrs on %s failed (%s)", loc->path,
+ strerror (errno));
+ }
+
op_ret = posix_lstat_with_gfid (this, real_path, &stbuf);
if (op_ret == -1) {
op_errno = errno;
@@ -1718,6 +1739,13 @@ posix_create (call_frame_t *frame, xlator_t *this,
strerror (errno));
}
+ op_ret = posix_entry_create_xattr_set (this, real_path, params);
+ if (op_ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "setting xattrs on %s failed (%s)", loc->path,
+ strerror (errno));
+ }
+
op_ret = posix_fstat_with_gfid (this, _fd, &stbuf);
if (op_ret == -1) {
op_errno = errno;