]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
dax: remove the pmem_dax_ops->flush abstraction
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 1 Sep 2017 01:47:43 +0000 (21:47 -0400)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 12 Oct 2017 21:20:00 +0000 (16:20 -0500)
commit4bbce3bf2e0a811423d5e143d70ec391918d78bf
treec55813d36ef8ba17731771cce90913efe8aa698f
parent20d12c6e9d52249444bb58b668dff511908c4f7f
dax: remove the pmem_dax_ops->flush abstraction

BugLink: http://bugs.launchpad.net/bugs/1721777
commit c3ca015fab6df124c933b91902f3f2a3473f9da5 upstream.

Commit abebfbe2f731 ("dm: add ->flush() dax operation support") is
buggy. A DM device may be composed of multiple underlying devices and
all of them need to be flushed. That commit just routes the flush
request to the first device and ignores the other devices.

It could be fixed by adding more complex logic to the device mapper. But
there is only one implementation of the method pmem_dax_ops->flush - that
is pmem_dax_flush() - and it calls arch_wb_cache_pmem(). Consequently, we
don't need the pmem_dax_ops->flush abstraction at all, we can call
arch_wb_cache_pmem() directly from dax_flush() because dax_dev->ops->flush
can't ever reach anything different from arch_wb_cache_pmem().

It should be also pointed out that for some uses of persistent memory it
is needed to flush only a very small amount of data (such as 1 cacheline),
and it would be overkill if we go through that device mapper machinery for
a single flushed cache line.

Fix this by removing the pmem_dax_ops->flush abstraction and call
arch_wb_cache_pmem() directly from dax_flush(). Also, remove the device
mapper code that forwards the flushes.

Fixes: abebfbe2f731 ("dm: add ->flush() dax operation support")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/dax/super.c
drivers/md/dm-linear.c
drivers/md/dm-stripe.c
drivers/md/dm.c
drivers/nvdimm/pmem.c
fs/dax.c
include/linux/dax.h
include/linux/device-mapper.h