diff options
author | Christoph Hellwig | 2019-07-01 23:54:31 +0200 |
---|---|---|
committer | Andreas Gruenbacher | 2019-07-03 08:53:01 +0200 |
commit | f3915f83e84c1f14358aaa91e8785d6169092176 (patch) | |
tree | 00ea8c4b154989fdaade319614f584b17f1bb8d0 /fs | |
parent | f29e62eed261f01431d348d8b22a6f275d553a51 (diff) |
gfs2: use page_offset in gfs2_page_mkwrite
Without casting page->index to a guaranteed 64-bit type, the value might be
treated as 32-bit on 32-bit platforms and thus get truncated.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 28bdbeb11030..5d61113b3f50 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -408,7 +408,7 @@ static vm_fault_t gfs2_page_mkwrite(struct vm_fault *vmf) struct gfs2_sbd *sdp = GFS2_SB(inode); struct gfs2_alloc_parms ap = { .aflags = 0, }; unsigned long last_index; - u64 pos = page->index << PAGE_SHIFT; + u64 pos = page_offset(page); unsigned int data_blocks, ind_blocks, rblocks; struct gfs2_holder gh; loff_t size; |