GFS2: Be extra careful about deallocating inodes
authorSteven Whitehouse <swhiteho@redhat.com>
Tue, 8 Sep 2009 17:00:30 +0000 (18:00 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 8 Sep 2009 17:00:30 +0000 (18:00 +0100)
commitacf7e2444acfaf4c8540603b76d71010eea3fc24
tree7c31957ffbbb4008f368b8640c289f72657330a5
parent8d8291ae93ecb4a246e87e452d55cca412373300
GFS2: Be extra careful about deallocating inodes

There is a potential race in the inode deallocation code if two
nodes try to deallocate the same inode at the same time. Most of
the issue is solved by the iopen locking. There is still a small
window which is not covered by the iopen lock. This patches fixes
that and also makes the deallocation code more robust in the face of
any errors in the rgrp bitmaps, or erroneous iopen callbacks from
other nodes.

This does introduce one extra disk read, but that is generally not
an issue since its the same block that must be written to later
in the deallocation process. The total disk accesses therefore stay
the same,

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/export.c
fs/gfs2/rgrp.c
fs/gfs2/rgrp.h
fs/gfs2/super.c