]> 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)
commit11854fa55dd898d3f018dde895c8e6156dbf62fe
treed69b8eaa5b297bb70528c7a0a8290ebd65c24be6
parent89b1f0ccd6cc69dfe4a0958e362b5d1b78e1a43d
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 d3d097939229
("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: b44b1c0ab7ff ("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