[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1568989415.156942783@decadent.org.uk>
Date: Fri, 20 Sep 2019 15:23:35 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Bob Peterson" <rpeterso@...hat.com>
Subject: [PATCH 3.16 102/132] GFS2: Fix rgrp end rounding problem for
bsize < page size
3.16.74-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Bob Peterson <rpeterso@...hat.com>
commit 31dddd9eb9ebae9a2a9b502750e9e481d752180a upstream.
This patch fixes a bug introduced by commit 7005c3e. That patch
tries to map a vm range for resource groups, but the calculation
breaks down when the block size is less than the page size.
Signed-off-by: Bob Peterson <rpeterso@...hat.com>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
fs/gfs2/rgrp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -926,8 +926,9 @@ static int read_rindex_entry(struct gfs2
goto fail;
rgd->rd_gl->gl_object = rgd;
- rgd->rd_gl->gl_vm.start = rgd->rd_addr * bsize;
- rgd->rd_gl->gl_vm.end = rgd->rd_gl->gl_vm.start + (rgd->rd_length * bsize) - 1;
+ rgd->rd_gl->gl_vm.start = (rgd->rd_addr * bsize) & PAGE_CACHE_MASK;
+ rgd->rd_gl->gl_vm.end = PAGE_CACHE_ALIGN((rgd->rd_addr +
+ rgd->rd_length) * bsize) - 1;
rgd->rd_rgl = (struct gfs2_rgrp_lvb *)rgd->rd_gl->gl_lksb.sb_lvbptr;
rgd->rd_flags &= ~GFS2_RDF_UPTODATE;
if (rgd->rd_data > sdp->sd_max_rg_data)
Powered by blists - more mailing lists