]> git.baikalelectronics.ru Git - kernel.git/commit
nvdimm/pmem: stop using q_usage_count as external pgmap refcount
authorChristoph Hellwig <hch@lst.de>
Tue, 19 Oct 2021 07:36:40 +0000 (09:36 +0200)
committerDan Williams <dan.j.williams@intel.com>
Mon, 25 Oct 2021 23:12:32 +0000 (16:12 -0700)
commite662f90c2744f15b00f4a9bd2f8118a82224bd77
treed69b8eaa5b297bb70528c7a0a8290ebd65c24be6
parentb114c3a618ef6a3ea61591a832ce8e1cf2476a14
nvdimm/pmem: stop using q_usage_count as external pgmap refcount

Originally all DAX access when through block_device operations and thus
needed a queue reference.  But since commit 7c0622e6db85
("filesystem-dax: convert to dax_direct_access()") all this happens at
the DAX device level which uses its own refcounting.  Having the external
refcount thus wasn't needed but has otherwise been harmless for long
time.

But now that "block: drain file system I/O on del_gendisk" waits for
q_usage_count to reach 0 in del_gendisk this whole scheme can't work
anymore (and pmem is the only driver abusing q_usage_count like that).
So switch to the internal reference and remove the unbalanced
blk_freeze_queue_start that is taken care of by del_gendisk.

Fixes: 7786af00b12a ("block: drain file system I/O on del_gendisk")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211019073641.2323410-2-hch@lst.de
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/pmem.c