diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2019-06-08 01:22:27 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-08-01 04:12:07 +0000 |
commit | d68e426263708334945dff69b88218ed71a48033 (patch) | |
tree | c9739c005f4531493593e07c60594b4ad6944794 /xlators/features/quota | |
parent | d7e449b0da35a30af876aef1bea1fb096d0c06dc (diff) |
Multiple files: get trivial stuff done before lock
Initialize a dictionary for example seems to be prefectly fine to be done
before taking a lock.
Change-Id: Ib29516c4efa8f0e2b526d512beab488fcd16d2e7
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/features/quota')
-rw-r--r-- | xlators/features/quota/src/quota.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index c014c99cbd2..34dac481a64 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -560,15 +560,14 @@ quota_handle_validate_error(call_frame_t *frame, int32_t op_ret, if (local == NULL) goto out; - LOCK(&local->lock); - { - if (op_ret < 0) { + if (op_ret < 0) { + LOCK(&local->lock); + { local->op_ret = op_ret; local->op_errno = op_errno; } + UNLOCK(&local->lock); } - UNLOCK(&local->lock); - /* we abort checking limits on this path to root */ quota_link_count_decrement(frame); out: |