Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d69883e authored by Vaibhav Jain's avatar Vaibhav Jain Committed by Lee Jones
Browse files

UPSTREAM: libnvdimm/region: Fix nvdimm_has_flush() to handle ND_REGION_ASYNC

In case a platform doesn't provide explicit flush-hints but provides an
explicit flush callback via ND_REGION_ASYNC region flag, then
nvdimm_has_flush() still returns '0' indicating that writes do not
require flushing. This happens on PPC64 with patch at [1] applied, where
'deep_flush' of a region was denied even though an explicit flush
function was provided.

Fix this by adding a condition to nvdimm_has_flush() to test for the
ND_REGION_ASYNC flag on the region and see if a 'region->flush' callback
is assigned.

Bug: 254441685
Link: http://lore.kernel.org/r/161703936121.36.7260632399582101498.stgit@e1fbed493c87

 [1]
Fixes: c5d4355d10d4 ("libnvdimm: nd_region flush callback support")
Reported-by: default avatarShivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: default avatarVaibhav Jain <vaibhav@linux.ibm.com>
Link: https://lore.kernel.org/r/20210402092555.208590-1-vaibhav@linux.ibm.com


Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
(cherry picked from commit a2948b17f6b936fc52f86c0f92c46d2f91928b79)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I220650135909d6a57f46443ea98b9aae5228d008
parent fb9ad704
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment