[PATCH 1/1] PMFS: pmbd: fix request queue capability selection

Nicholas Moulin nicholas.w.moulin at linux.intel.com
Tue May 14 12:10:02 EDT 2013

From: Nicholas Moulin <nicholas.w.moulin at linux.intel.com>

Fix a bug that allowed a call to blk_queue_flush() selecting only
REQ_FUA without selecting REQ_FLUSH as well.

Signed-off-by: Nicholas Moulin <nicholas.w.moulin at intel.com>

The affect of the bug was just an annoying kernel warning and FUA not
being set for the queue in question. The cause of the bug was that the
function blk_queue_flush requires that for FUA to be enabled FLUSH needs
to be enabled as well. blk_queue_flush() is defined in blk_settings.c
for more information.

 drivers/block/pmbd.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/block/pmbd.c b/drivers/block/pmbd.c
index 62d61f7..8cc9b5d 100644
--- a/drivers/block/pmbd.c
+++ b/drivers/block/pmbd.c
@@ -226,7 +226,7 @@ static unsigned g_pmbd_type 		= PMBD_CONFIG_HIGHMEM;	/* vmalloc(PMBD_CONFIG_VMAL
 static unsigned g_pmbd_pmap		= FALSE;		/* use pmap_atomic() to map/unmap space on demand  */
 static unsigned g_pmbd_nts		= FALSE;		/* use non-temporal store (movntq) */
 static unsigned g_pmbd_wb		= FALSE;		/* use write barrier */
-static unsigned g_pmbd_fua		= TRUE;			/* use fua support (Linux 3.2.1) */
+static unsigned g_pmbd_fua		= TRUE;	/* use fua support */
 static unsigned g_pmbd_mergeable 	= TRUE;			/* mergeable or not  */
 static unsigned g_pmbd_cpu_cache_clflush= FALSE;	 	/* flush CPU cache or not*/
 static unsigned g_pmbd_wr_protect	= FALSE;		/* flip PTE R/W bits for write protection */
@@ -4382,12 +4382,10 @@ static PMBD_DEVICE_T *pmbd_alloc(int i)
 	/* set flush capability, otherwise, WRITE_FLUSH and WRITE_FUA will be filtered in
  	   generic_make_request() */
-	if (PMBD_USE_FUA() && PMBD_USE_WB())
+	if (PMBD_USE_FUA())
 		blk_queue_flush(pmbd->pmbd_queue, REQ_FLUSH | REQ_FUA);
 	else if (PMBD_USE_WB())
 		blk_queue_flush(pmbd->pmbd_queue, REQ_FLUSH);
-	else if (PMBD_USE_FUA())
-		blk_queue_flush(pmbd->pmbd_queue, REQ_FUA);
 	blk_queue_max_hw_sectors(pmbd->pmbd_queue, 1024);
 	blk_queue_bounce_limit(pmbd->pmbd_queue, BLK_BOUNCE_ANY);

More information about the Linux-pmfs mailing list