alistair23-linux/fs/gfs2
Bob Peterson dc8fbb03dc GFS2: gfs2_free_extlen can return an extent that is too long
Function gfs2_free_extlen calculates the length of an extent of
free blocks that may be reserved. The end pointer was calculated as
end = start + bh->b_size but b_size is incorrect because the
bitmap usually stops prior to the end of the buffer data on
the last bitmap.

What this means is that when you do a write, you can reserve a
chunk of blocks that runs off the end of the last bitmap. For
example, I've got a file system where there is only one bitmap
for each rgrp, so ri_length==1. I saw cases in which iozone
tried to do a big write, grabbed a large block reservation,
chose rgrp 5464152, which has ri_data0 5464153 and ri_data 8188.
So 5464153 + 8188 = 5472341 which is the end of the rgrp.

When it grabbed a reservation it got back: 5470936, length 7229.
But 5470936 + 7229 = 5478165. So the reservation starts inside
the rgrp but runs 5824 blocks past the end of the bitmap.

This patch fixes the calculation so it won't exceed the last
bitmap. It also adds a BUG_ON to guard against overflows in the
future.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
2018-06-04 07:33:42 -05:00
..
acl.c
acl.h
aops.c GFS2: Fix allocation error bug with recursive rgrp glocking 2018-06-04 07:33:17 -05:00
bmap.c gfs2: Update find_metapath comment 2018-06-04 07:32:44 -05:00
bmap.h gfs2: Implement fallocate(FALLOC_FL_PUNCH_HOLE) 2018-01-18 21:15:58 +01:00
dentry.c
dir.c gfs2: Dirty source inode during rename 2018-03-08 09:26:20 -07:00
dir.h
export.c
file.c gfs2: Zero out fallocated blocks in fallocate_chunk 2018-03-29 06:50:32 -07:00
gfs2.h
glock.c gfs2: Stop using rhashtable_walk_peek 2018-04-12 09:41:19 -07:00
glock.h
glops.c GFS2: Log the reason for log flushes in every log header 2018-01-23 07:39:20 -07:00
glops.h
incore.h GFS2: gfs2_free_extlen can return an extent that is too long 2018-06-04 07:33:42 -05:00
inode.c gfs2: Dirty source inode during rename 2018-03-08 09:26:20 -07:00
inode.h
Kconfig gfs2: Fix the crc32c dependency 2018-02-01 11:25:31 -07:00
lock_dlm.c gfs2: Add a few missing newlines in messages 2018-01-30 10:32:30 -07:00
log.c GFS2: Make function gfs2_remove_from_ail static 2018-03-08 09:26:20 -07:00
log.h GFS2: Make function gfs2_remove_from_ail static 2018-03-08 09:26:20 -07:00
lops.c GFS2: Fix minor comment typo 2018-01-25 10:18:06 -07:00
lops.h GFS2: Introduce new gfs2_log_header_v2 2018-01-23 07:38:53 -07:00
main.c gfs2: Fix wrong error handling in init_gfs2_fs() 2017-11-27 10:47:22 -06:00
Makefile
meta_io.c
meta_io.h
ops_fstype.c gfs2: Remove sdp->sd_jheightsize 2018-04-16 09:25:21 -07:00
quota.c GFS2: Log the reason for log flushes in every log header 2018-01-23 07:39:20 -07:00
quota.h gfs2: Fix fallocate chunk size 2018-03-08 09:26:20 -07:00
recovery.c gfs2: time journal recovery steps accurately 2018-03-29 10:41:27 -07:00
recovery.h
rgrp.c GFS2: gfs2_free_extlen can return an extent that is too long 2018-06-04 07:33:42 -05:00
rgrp.h
super.c fs: move I_DIRTY_INODE to fs.h 2018-03-28 01:39:02 -04:00
super.h
sys.c gfs2: Add a few missing newlines in messages 2018-01-30 10:32:30 -07:00
sys.h
trace_gfs2.h gfs2: gfs2_iomap_end tracepoint: log block address 2018-03-15 07:17:17 -07:00
trans.c GFS2: Log the reason for log flushes in every log header 2018-01-23 07:39:20 -07:00
trans.h
util.c
util.h
xattr.c gfs2: fix bogus __mark_inode_dirty(I_DIRTY_SYNC | I_DIRTY_DATASYNC) calls 2018-03-28 01:39:01 -04:00
xattr.h