diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2019-06-20 17:05:49 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2019-06-22 05:06:15 +0000 |
commit | e2f2f414f855f9a3da269745ae3db2d27baa7f3d (patch) | |
tree | 1ac8d21264b27b63e0d3b75b9f61d012bc7cc0ca /xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.h | |
parent | 2959fbfbb77e2b1b2ccbc90610f8ff9362109ae3 (diff) |
cluster/ec: Prevent double pre-op xattrops
Problem:
Race:
Thread-1 Thread-2
1) Does ec_get_size_version() to perform
pre-op fxattrop as part of write-1
2) Calls ec_set_dirty_flag() in
ec_get_size_version() for write-2.
This sets dirty[] to 1
3) Completes executing
ec_prepare_update_cbk leading to
ctx->dirty[] = '1'
4) Takes LOCK(inode->lock) to check if there are
any flags and sets dirty-flag because
lock->waiting_flag is 0 now. This leads to
fxattrop to increment on-disk dirty[] to '2'
At the end of the writes the file will be marked for heal even when it doesn't need heal.
Fix:
Perform ec_set_dirty_flag() and other checks inside LOCK() to prevent dirty[] to be marked
as '1' in step 2) above
Updates bz#1593224
Change-Id: Icac2ab39c0b1e7e154387800fbededc561612865
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.h')
0 files changed, 0 insertions, 0 deletions