linux-stable/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 gfs2: Always update inode ctime in set_acl 2017-09-25 12:33:19 -05:00
acl.h gfs2: Switch to generic xattr handlers 2016-05-12 22:28:05 -04:00
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 gfs2: Lock holder cleanup 2016-06-27 09:47:09 -05:00
dir.c gfs2: Dirty source inode during rename 2018-03-08 09:26:20 -07:00
dir.h GFS2: Make rename not save dirent location 2014-10-01 14:06:15 +01:00
export.c gfs2: Get rid of gfs2_ilookup 2016-06-27 09:47:08 -05:00
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 gfs2: gfs2_evict_inode: Put glocks asynchronously 2017-08-10 10:45:21 -05:00
glops.c GFS2: Log the reason for log flushes in every log header 2018-01-23 07:39:20 -07:00
glops.h GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
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 gfs2: Implement SEEK_HOLE / SEEK_DATA via iomap 2017-10-31 14:26:35 +01:00
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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
meta_io.c Merge branch 'for-4.14/block' of git://git.kernel.dk/linux-block 2017-09-07 11:59:42 -07:00
meta_io.h GFS2: Refactor gfs2_remove_from_journal 2016-05-06 11:27:27 -05:00
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 GFS2: Fix gfs2_replay_incr_blk for multiple journal sizes 2016-07-21 13:02:44 -05:00
rgrp.c GFS2: gfs2_free_extlen can return an extent that is too long 2018-06-04 07:33:42 -05:00
rgrp.h GFS2: Non-recursive delete 2017-04-19 08:25:43 -04:00
super.c fs: move I_DIRTY_INODE to fs.h 2018-03-28 01:39:02 -04:00
super.h GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
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 Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
util.h GFS2: Fix up some sparse warnings 2017-08-25 18:47:18 -05:00
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 gfs2: Remove gfs2_xattr_acl_chmod 2015-12-06 21:25:17 -05:00