From ec0d7d77de3e4bd485a4fa2e53c9137e25c71ce7 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Tue, 17 Jul 2018 20:35:42 +0530 Subject: afr: switch lk_owner only when pre-op succeeds Problem: In a disk full scenario, we take a failure path in afr_transaction_perform_fop() and go to unlock phase. But we change the lk-owner before that, causing unlock to fail. When mount issues another fop that takes locks on that file, it hangs. Fix: Change lk-owner only when we are about to perform the fop phase. Also fix the same issue for arbiters when afr_txn_arbitrate_fop() fails the fop. Also removed the DISK_SPACE_CHECK_AND_GOTO in posix_xattrop. Otherwise truncate to zero will fail pre-op phase with ENOSPC when the user is actually trying to freee up space. Change-Id: Ic4c8a596b4cdf4a7fc189bf00b561113cf114353 fixes: bz#1602236 Signed-off-by: Ravishankar N --- xlators/storage/posix/src/posix-inode-fd-ops.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'xlators/storage/posix/src/posix-inode-fd-ops.c') diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c index 0e7d3762ac8..8cfc4bceebc 100644 --- a/xlators/storage/posix/src/posix-inode-fd-ops.c +++ b/xlators/storage/posix/src/posix-inode-fd-ops.c @@ -4416,16 +4416,11 @@ do_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, dict_t *xattr_rsp = NULL; dict_t *xdata_rsp = NULL; struct iatt stbuf = {0}; - struct posix_private *priv = NULL; - VALIDATE_OR_GOTO (frame, out); VALIDATE_OR_GOTO (xattr, out); VALIDATE_OR_GOTO (this, out); - priv = this->private; - DISK_SPACE_CHECK_AND_GOTO (frame, priv, xdata, op_ret, op_errno, out); - if (fd) { op_ret = posix_fd_ctx_get (fd, this, &pfd, &op_errno); if (op_ret < 0) { -- cgit