diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2007-01-08 09:31:40 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-02-05 13:36:24 -0500 |
commit | 49686f71060e342bce6644a5c69fbc6ad0e75a13 (patch) | |
tree | b0cb01ccb67d7e4d71a8d17051f53dae475bfc20 /fs/gfs2 | |
parent | 4edde74eedb8bc4c03adc3602b114b72a7ccd13f (diff) |
[GFS2] Fix ordering of page disposal vs. glock_dq
In case of unlinked files with dirty pages GFS2 wasn't clearing
the pages in quite the right order. This patch clears the pages
earlier (before the qlock_dq) to avoid the situation that the
release of the glock results in attempting to write back data that
has already been deallocated.
This fixes Red Hat bugzilla: #220117
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/ops_super.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c index b2837839eed9..c22738cdbf2d 100644 --- a/fs/gfs2/ops_super.c +++ b/fs/gfs2/ops_super.c | |||
@@ -429,6 +429,12 @@ static void gfs2_delete_inode(struct inode *inode) | |||
429 | } | 429 | } |
430 | 430 | ||
431 | error = gfs2_dinode_dealloc(ip); | 431 | error = gfs2_dinode_dealloc(ip); |
432 | /* | ||
433 | * Must do this before unlock to avoid trying to write back | ||
434 | * potentially dirty data now that inode no longer exists | ||
435 | * on disk. | ||
436 | */ | ||
437 | truncate_inode_pages(&inode->i_data, 0); | ||
432 | 438 | ||
433 | out_unlock: | 439 | out_unlock: |
434 | gfs2_glock_dq(&ip->i_iopen_gh); | 440 | gfs2_glock_dq(&ip->i_iopen_gh); |