diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 82462db95..b901b673f 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -652,6 +652,18 @@ posix_setattr (call_frame_t *frame, xlator_t *this, } } + if (!valid) { + op_ret = lchown (real_path, -1, -1); + if (op_ret == -1) { + op_errno = errno; + gf_log (this->name, GF_LOG_ERROR, + "lchown (%s, -1, -1) failed => (%s)", + real_path, strerror (op_errno)); + + goto out; + } + } + op_ret = posix_lstat_with_gen (this, real_path, &statpost); if (op_ret == -1) { op_errno = errno; @@ -782,6 +794,18 @@ posix_fsetattr (call_frame_t *frame, xlator_t *this, } } + if (!valid) { + op_ret = fchown (pfd->fd, -1, -1); + if (op_ret == -1) { + op_errno = errno; + gf_log (this->name, GF_LOG_ERROR, + "fchown (%d, -1, -1) failed => (%s)", + pfd->fd, strerror (op_errno)); + + goto out; + } + } + op_ret = posix_fstat_with_gen (this, pfd->fd, &statpost); if (op_ret == -1) { op_errno = errno; |