diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2009-10-09 09:15:36 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-09 22:48:11 -0700 |
commit | 077d73fa467bcd0a5ac4be26bb4b366d5fc20a69 (patch) | |
tree | 605256e0e725f375a0f9aedb6b23d9e47a8ef354 /xlators/storage | |
parent | 73027dae835fc968dc443294fc8c109110168d37 (diff) |
posix: Ensure ENOTEMPTY return on rmdir
Since we added an extra step after rmdir, i.e.
the lstat on parent dir as part of the NFS-friendly
changes, the successful return from postparent lstat
clobbers the -1 error return from rmdir.
This prevents this particularly ENOTEMPTY error from
being propagated to higher translators.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 145 (NFSv3 related additions to 2.1 task list)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index f681b1dc69c..fa70dd274fb 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -1486,13 +1486,16 @@ posix_rmdir (call_frame_t *frame, xlator_t *this, /* Solaris sets errno = EEXIST instead of ENOTEMPTY */ op_errno = ENOTEMPTY; + /* No need to log a common error as ENOTEMPTY */ if (op_ret == -1 && op_errno != ENOTEMPTY) { gf_log (this->name, GF_LOG_ERROR, "rmdir of %s failed: %s", loc->path, strerror (op_errno)); - goto out; } + if (op_ret == -1) + goto out; + op_ret = lstat (parentpath, &postparent); if (op_ret == -1) { op_errno = errno; |