]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
bcache: add comments for mutex_lock(&b->write_lock)
authorColy Li <colyli@suse.de>
Fri, 28 Jun 2019 11:59:56 +0000 (19:59 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commitb695d8c622d93034846af90b0a18119b5d8e2d63
treefef0d1fe2dc3e250121ef97dc9b61e2984c8b119
parent3b44dcc16dc880cec637388417b1f1cf35ed6552
bcache: add comments for mutex_lock(&b->write_lock)

BugLink: https://bugs.launchpad.net/bugs/1844558
[ Upstream commit 41508bb7d46b74dba631017e5a702a86caf1db8c ]

When accessing or modifying BTREE_NODE_dirty bit, it is not always
necessary to acquire b->write_lock. In bch_btree_cache_free() and
mca_reap() acquiring b->write_lock is necessary, and this patch adds
comments to explain why mutex_lock(&b->write_lock) is necessary for
checking or clearing BTREE_NODE_dirty bit there.

Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/md/bcache/btree.c