1
linux/fs/gfs2
Steven Whitehouse f75bbfb4dd GFS2: Fix off-by-one in gfs2_blk2rgrpd
Bob reported:

I found an off-by-one problem with how I coded this section:
It should be:

+ else if (blk >= cur->rd_data0 + cur->rd_data)

In fact, cur->rd_data0 + cur->rd_data is the start of the next
rgrp (the next ri_addr), so without the "=" check it can land on
the wrong rgrp.

In all normal cases, this won't be a problem: you're searching
for a block _within_ the rgrp, which will pass the test properly.
Where it gets into trouble is if you search the rgrps for the
block exactly equal to ri_addr.  I don't think anything in the
kernel does this, but I found a place in gfs2-utils gfs2_edit
where it does.  So I definitely need to fix it in libgfs2.  I'd
like to suggest we fix it in the kernel as well for the sake of
keeping the functions similar.

So this patch fixes the above mentioned off by one error as well
as removing the unused parent pointer.

Reported-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2011-10-21 12:39:46 +01:00
..
acl.c GFS2: Use ->dirty_inode() 2011-10-21 12:39:26 +01:00
acl.h fs: take the ACL checks to common code 2011-07-25 14:30:23 -04:00
aops.c GFS2: Cache the most recently used resource group in the inode 2011-10-21 12:39:34 +01:00
bmap.c GFS2: Use cached rgrp in gfs2_rlist_add() 2011-10-21 12:39:39 +01:00
bmap.h
dentry.c
dir.c GFS2: Use cached rgrp in gfs2_rlist_add() 2011-10-21 12:39:39 +01:00
dir.h GFS2: Cache dir hash table in a contiguous buffer 2011-07-15 09:31:48 +01:00
export.c GFS2: Make writeback more responsive to system conditions 2011-04-20 09:01:37 +01:00
file.c GFS2: Clean up ->page_mkwrite 2011-10-21 12:39:44 +01:00
gfs2.h
glock.c GFS2: Automatically adjust glock min hold time 2011-07-15 09:32:11 +01:00
glock.h GFS2: Automatically adjust glock min hold time 2011-07-15 09:32:11 +01:00
glops.c GFS2: Fix AIL flush issue during fsync 2011-10-21 12:39:41 +01:00
glops.h GFS2: Fix AIL flush issue during fsync 2011-10-21 12:39:41 +01:00
incore.h GFS2: Cache the most recently used resource group in the inode 2011-10-21 12:39:34 +01:00
inode.c GFS2: Cache the most recently used resource group in the inode 2011-10-21 12:39:34 +01:00
inode.h GFS2: Use ->dirty_inode() 2011-10-21 12:39:26 +01:00
Kconfig
lock_dlm.c
log.c block: separate priority boosting from REQ_META 2011-08-23 14:50:29 +02:00
log.h GFS2: Make writeback more responsive to system conditions 2011-04-20 09:01:37 +01:00
lops.c GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
lops.h
main.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
Makefile GFS2: Rename ops_inode.c to inode.c 2011-05-10 13:12:49 +01:00
meta_io.c block: separate priority boosting from REQ_META 2011-08-23 14:50:29 +02:00
meta_io.h
ops_fstype.c GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
quota.c GFS2: Cache the most recently used resource group in the inode 2011-10-21 12:39:34 +01:00
quota.h vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
recovery.c
recovery.h
rgrp.c GFS2: Fix off-by-one in gfs2_blk2rgrpd 2011-10-21 12:39:46 +01:00
rgrp.h GFS2: Use cached rgrp in gfs2_rlist_add() 2011-10-21 12:39:39 +01:00
super.c GFS2: Fix AIL flush issue during fsync 2011-10-21 12:39:41 +01:00
super.h
sys.c GFS2: Fix race during filesystem mount 2011-07-12 09:15:46 +01:00
sys.h
trace_gfs2.h GFS2: Add an AIL writeback tracepoint 2011-04-20 09:01:58 +01:00
trans.c GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
trans.h GFS2: Cache the most recently used resource group in the inode 2011-10-21 12:39:34 +01:00
util.c
util.h
xattr.c GFS2: Use cached rgrp in gfs2_rlist_add() 2011-10-21 12:39:39 +01:00
xattr.h