aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2018-08-02 13:09:27 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-02 13:09:27 -0700
commit79b3dbe4adb3420e74cf755b4beb5d2b43d5928d (patch)
treed49aae11f8919138e3a43ef830e6bd68fd4e89bf
parentd4a34e16555708bab5b67e679a95f055d8ef9882 (diff)
downloadlinux-79b3dbe4adb3420e74cf755b4beb5d2b43d5928d.tar.gz
fs: fix iomap_bmap position calculation
The position calculation in iomap_bmap() shifts bno the wrong way, so we don't progress properly and end up re-mapping block zero over and over, yielding an unchanging physical block range as the logical block advances: # filefrag -Be file ext: logical_offset: physical_offset: length: expected: flags: 0: 0.. 0: 21.. 21: 1: merged 1: 1.. 1: 21.. 21: 1: 22: merged Discontinuity: Block 1 is at 21 (was 22) 2: 2.. 2: 21.. 21: 1: 22: merged Discontinuity: Block 2 is at 21 (was 22) 3: 3.. 3: 21.. 21: 1: 22: merged This breaks the FIBMAP interface for anyone using it (XFS), which in turn breaks LILO, zipl, etc. Bug-actually-spotted-by: Darrick J. Wong <darrick.wong@oracle.com> Fixes: 89eb1906a953 ("iomap: add an iomap-based bmap implementation") Cc: stable@vger.kernel.org Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/iomap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/iomap.c b/fs/iomap.c
index 77397b5a96ef9c..0d0bd88455867f 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -1443,7 +1443,7 @@ iomap_bmap(struct address_space *mapping, sector_t bno,
const struct iomap_ops *ops)
{
struct inode *inode = mapping->host;
- loff_t pos = bno >> inode->i_blkbits;
+ loff_t pos = bno << inode->i_blkbits;
unsigned blocksize = i_blocksize(inode);
if (filemap_write_and_wait(mapping))
a href='/pub/scm/linux/kernel/git/sashal/deps.git/commit/v4.4?id=a4eddaaa7ab59179ddce76b25e9b78e8bccb6490'>Thu Mar 10 12:57:48 PM UTC 2022Sasha Levin1-0/+3 2022-03-10Thu Mar 10 12:53:55 PM UTC 2022Sasha Levin22-0/+132 2022-03-09Wed Mar 9 11:35:45 PM UTC 2022Sasha Levin8-0/+68 2022-03-09Wed Mar 9 10:45:13 PM UTC 2022Sasha Levin3-0/+34 2022-03-08Tue Mar 8 09:58:03 PM UTC 2022Sasha Levin1-0/+5 2022-03-08Tue Mar 8 08:31:22 PM UTC 2022Sasha Levin2-0/+8 2022-03-08Tue Mar 8 06:43:34 PM UTC 2022Sasha Levin36-0/+399 2022-03-07Mon Mar 7 10:09:43 PM UTC 2022Sasha Levin18-0/+218 2022-03-06Sun Mar 6 10:58:51 PM UTC 2022Sasha Levin1-0/+15 2022-03-06Sun Mar 6 09:16:02 PM UTC 2022Sasha Levin18-0/+287 2022-03-06Sun Mar 6 12:46:23 AM UTC 2022Sasha Levin7-0/+49 2022-03-05Sat Mar 5 09:22:24 PM UTC 2022Sasha Levin12-0/+122 2022-03-05Sat Mar 5 01:01:57 AM UTC 2022Sasha Levin