From 7847db9a6dc560cb0078bdfdb0ac0187e8a79443 Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Tue, 22 Jul 2014 18:49:44 +0530 Subject: posix: Fix unlink failing under specific condition PROBLEM: Files are undeletable when these three conditions are met: 1. File does not have trusted.pgfid. xattr set. This won't be set when build-pgfid is off (default). 2. File has hardlink count > 1. 3. build-pgfid option is turned on. FIX: Allow unlink on files not having trusted.pgfid. xattr. Change-Id: I58a9d9a1b29a0cb07f4959daabbd6dd04fab2b34 BUG: 1122028 Signed-off-by: Prashanth Pai Reviewed-on: http://review.gluster.org/8352 Tested-by: Gluster Build System Reviewed-by: Raghavendra G Tested-by: Raghavendra G --- xlators/storage/posix/src/posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/storage/posix/src') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index b712ab3f5e8..04b75d083e1 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -1586,7 +1586,9 @@ posix_unlink (call_frame_t *frame, xlator_t *this, gf_log (this->name, GF_LOG_WARNING, "modification of " "parent gfid xattr failed (path:%s gfid:%s)", real_path, uuid_utoa (loc->inode->gfid)); - goto out; + if (op_errno != ENOATTR) + /* Allow unlink if pgfid xattr is not set. */ + goto out; } } -- cgit