summaryrefslogtreecommitdiff
path: root/drivers/md/dm-mpath.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2019-04-18 10:29:48 -0400
committerMike Snitzer <snitzer@redhat.com>2019-04-18 16:18:34 -0400
commit873f258becca87f4dd973fe0ba09b88b737c9b14 (patch)
tree31585eb3e1f823bc82d715e2bb345d5c6d62e97b /drivers/md/dm-mpath.c
parent6a1b1ddc6a2cfb32da8f5e75f1aa053280682a05 (diff)
dm thin metadata: do not write metadata if no changes occurred
Otherwise, just activating a thin-pool and thin device and then deactivating them will cause the thin-pool metadata to be changed (e.g. superblock written) -- even without any metadata being changed. Add 'in_service' flag to struct dm_pool_metadata and set it in pmd_write_lock() because all on-disk metadata changes must take a write lock of pmd->root_lock. Once 'in_service' is set it is never cleared. __commit_transaction() will return 0 if 'in_service' is not set. dm_pool_commit_metadata() is updated to use __pmd_write_lock() so that it isn't the sole reason for putting a thin-pool in service. Also fix dm_pool_commit_metadata() to open the next transaction if the return from __commit_transaction() is 0. Not seeing why the early return ever made since for a return of 0 given that dm-io's async_io(), as used by bufio, always returns 0. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-mpath.c')
0 files changed, 0 insertions, 0 deletions