]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: dax_overflow_check reports incorrect data
authorSanath Kumar <sanath.s.kumar@oracle.com>
Tue, 4 Apr 2017 05:14:42 +0000 (00:14 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 24 Apr 2017 04:43:26 +0000 (21:43 -0700)
Orabug: 25820395

The range reported for a page overflow is incorrect when
the address is page_size aligned. Add 1 to the address so
that it always reports the next page_size boundary.

Reviewed-by: Rob Gardner <rob.gardner@oracle.com>
Signed-off-by: Sanath Kumar <sanath.s.kumar@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/dax/dax_misc.c

index 878c88f9bd21db0025540ff3339373562ebb140e..89b38988f092c5c1a432bda3aebae431510c7360 100644 (file)
@@ -216,13 +216,13 @@ void dax_overflow_check(struct dax_ctx *ctx, int idx)
 
                dax_dbg("*   Output address = 0x%lx, page size = 0x%lx; page overflow %s",
                        virtp, page_size,
-                       (virtp + ca->output_sz >= ALIGN(virtp, page_size)) ?
+                       (virtp + ca->output_sz >= ALIGN(virtp + 1, page_size)) ?
                                         "LIKELY" : "UNLIKELY");
                dax_dbg("*   Output size produced (0x%x) is %s the page bounds 0x%lx..0x%lx",
                        ca->output_sz,
-                       (virtp + ca->output_sz >= ALIGN(virtp, page_size)) ?
+                       (virtp + ca->output_sz >= ALIGN(virtp + 1, page_size)) ?
                                         "OUTSIDE" : "WITHIN",
-                       virtp, ALIGN(virtp, page_size));
+                       virtp, ALIGN(virtp + 1, page_size));
        }
 
        virtp = ccb->dwords[QUERY_DWORD_INPUT];
@@ -247,14 +247,14 @@ void dax_overflow_check(struct dax_ctx *ctx, int idx)
                dax_dbg("*   Input address = 0x%lx, page size = 0x%lx; page overflow %s",
                        virtp, page_size,
                        (virtp + input_size >=
-                        ALIGN(virtp, page_size)) ?
+                        ALIGN(virtp + 1, page_size)) ?
                                        "LIKELY" : "UNLIKELY");
                dax_dbg("*   Input size processed (0x%x) is %s the page bounds 0x%lx..0x%lx",
                        ca->n_processed,
                        (virtp + ca->n_processed >=
-                        ALIGN(virtp, page_size)) ?
+                        ALIGN(virtp + 1, page_size)) ?
                                        "OUTSIDE" : "WITHIN",
-                       virtp, ALIGN(virtp, page_size));
+                       virtp, ALIGN(virtp + 1, page_size));
        }
        dax_dbg("*************************");
 }