summaryrefslogtreecommitdiff
path: root/drivers/md/dm-bufio.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2015-12-21 02:51:00 +0300
committerNeilBrown <neilb@suse.com>2016-01-06 03:39:17 +0300
commit8b9277c81450de9d8081ff6571ac5986e6c83f49 (patch)
tree206498fac4ad1631d4e107f9d64788296a7dbd2b /drivers/md/dm-bufio.c
parent15858fa5b00c1067a8a8e53ea32f4a65f8bebbb8 (diff)
downloadlinux-8b9277c81450de9d8081ff6571ac5986e6c83f49.tar.xz
md-cluster: Protect communication with mutexes
Communication can happen through multiple threads. It is possible that one thread steps over another threads sequence. So, we use mutexes to protect both the send and receive sequences. Send communication is locked through state bit, MD_CLUSTER_SEND_LOCK. Communication is locked with bit manipulation in order to allow "lock and hold" for the add operation. In case of an add operation, if the lock is held, MD_CLUSTER_SEND_LOCKED_ALREADY is set. When md_update_sb() calls metadata_update_start(), it checks (in a single statement to avoid races), if the communication is already locked. If yes, it merely returns zero, else it locks the token lockresource. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/dm-bufio.c')
0 files changed, 0 insertions, 0 deletions