linux/fs/gfs2
Steven Whitehouse 044b9414c7 GFS2: Fix inode deallocation race
This area of the code has always been a bit delicate due to the
subtleties of lock ordering. The problem is that for "normal"
alloc/dealloc, we always grab the inode locks first and the rgrp lock
later.

In order to ensure no races in looking up the unlinked, but still
allocated inodes, we need to hold the rgrp lock when we do the lookup,
which means that we can't take the inode glock.

The solution is to borrow the technique already used by NFS to solve
what is essentially the same problem (given an inode number, look up
the inode carefully, checking that it really is in the expected
state).

We cannot do that directly from the allocation code (lock ordering
again) so we give the job to the pre-existing delete workqueue and
carry on with the allocation as normal.

If we find there is no space, we do a journal flush (required anyway
if space from a deallocation is to be released) which should block
against the pending deallocations, so we should always get the space
back.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2010-11-15 12:44:42 +00:00
..
acl.c
acl.h
aops.c fs: kill block_prepare_write 2010-10-25 21:18:20 -04:00
bmap.c
bmap.h
dentry.c
dir.c
dir.h
export.c GFS2: Fix inode deallocation race 2010-11-15 12:44:42 +00:00
file.c locks: let the caller free file_lock on ->setlease failure 2010-10-31 06:35:15 -07:00
gfs2.h
glock.c GFS2: Fix inode deallocation race 2010-11-15 12:44:42 +00:00
glock.h
glops.c
glops.h
incore.h
inode.c GFS2: Fix inode deallocation race 2010-11-15 12:44:42 +00:00
inode.h GFS2: Fix inode deallocation race 2010-11-15 12:44:42 +00:00
Kconfig
lock_dlm.c
log.c Merge branch 'v2.6.36-rc8' into for-2.6.37/barrier 2010-10-19 09:13:04 +02:00
log.h
lops.c
lops.h
main.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2010-10-22 17:13:10 -07:00
Makefile
meta_io.c writeback: remove nonblocking/encountered_congestion references 2010-10-26 16:52:05 -07:00
meta_io.h
ops_fstype.c convert gfs2 2010-10-29 04:17:16 -04:00
ops_inode.c new helper: ihold() 2010-10-25 21:26:11 -04:00
quota.c
quota.h
recovery.c
recovery.h
rgrp.c GFS2: Fix inode deallocation race 2010-11-15 12:44:42 +00:00
rgrp.h
super.c gfs2: invalidate_inodes() is no-op there 2010-10-25 21:23:01 -04:00
super.h
sys.c
sys.h
trace_gfs2.h
trans.c
trans.h
util.c
util.h
xattr.c
xattr.h