diff options
| author | Ravishankar N <ravishankar@redhat.com> | 2018-07-17 20:35:42 +0530 | 
|---|---|---|
| committer | Ravishankar N <ravishankar@redhat.com> | 2018-07-18 16:49:56 +0000 | 
| commit | ec0d7d77de3e4bd485a4fa2e53c9137e25c71ce7 (patch) | |
| tree | 0afdd7146717a78765582362909b972fd27236ec /xlators/cluster | |
| parent | a75a419d39cd2e2907bcc6eed5b9a4a30a8a3f4d (diff) | |
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 <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster')
| -rw-r--r-- | xlators/cluster/afr/src/afr-transaction.c | 20 | 
1 files changed, 10 insertions, 10 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index 34f238f1cc8..77398519ba0 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -495,11 +495,10 @@ afr_txn_arbitrate_fop (call_frame_t *frame, xlator_t *this)                  local->op_errno =  ENOTCONN;                  for (i = 0; i < priv->child_count; i++)                          local->transaction.failed_subvols[i] = 1; -                afr_changelog_post_op (frame, this);/*uninherit should happen*/ -        } else { -                afr_transaction_fop (frame, this);          } +        afr_transaction_fop (frame, this); +          return;  } @@ -529,13 +528,6 @@ afr_transaction_perform_fop (call_frame_t *frame, xlator_t *this)                                  local->transaction.failed_subvols[i] = 1;                  }          } -        /*  Perform fops with the lk-owner from top xlator. -         *  Eg: lk-owner of posix-lk and flush should be same, -         *  flush cant clear the  posix-lks without that lk-owner. -         */ -        afr_save_lk_owner (frame); -        frame->root->lk_owner = -                local->transaction.main_frame->root->lk_owner;  	if (local->pre_op_compat)  		/* old mode, pre-op was done as afr_changelog_do() @@ -561,6 +553,14 @@ afr_transaction_perform_fop (call_frame_t *frame, xlator_t *this)          }  fop: +        /*  Perform fops with the lk-owner from top xlator. +         *  Eg: lk-owner of posix-lk and flush should be same, +         *  flush cant clear the  posix-lks without that lk-owner. +         */ +        afr_save_lk_owner (frame); +        frame->root->lk_owner = +                local->transaction.main_frame->root->lk_owner; +          if (priv->arbiter_count == 1) {                  afr_txn_arbitrate_fop (frame, this);          } else {  | 
