aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/incore.h
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-11-18 08:38:48 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2009-01-05 02:39:06 -0500
commit813e0c46c9e2a0c6f0b6e774faac82afd7a2e812 (patch)
treecb09aa118f9e053f02e17f7c5ff11139e8e22244 /fs/gfs2/incore.h
parent37b2c8377c98acb60cf4d0126e385ef2153bded9 (diff)
GFS2: Fix "truncate in progress" hang
Following on from the recent clean up of gfs2_quotad, this patch moves the processing of "truncate in progress" inodes from the glock workqueue into gfs2_quotad. This fixes a hang due to the "truncate in progress" processing requiring glocks in order to complete. It might seem odd to use gfs2_quotad for this particular item, but we have to use a pre-existing thread since creating a thread implies a GFP_KERNEL memory allocation which is not allowed from the glock workqueue context. Of the existing threads, gfs2_logd and gfs2_recoverd may deadlock if used for this operation. gfs2_scand and gfs2_glockd are both scheduled for removal at some (hopefully not too distant) future point. That leaves only gfs2_quotad whose workload is generally fairly light and is easily adapted for this extra task. Also, as a result of this change, it opens the way for a future patch to make the reading of the inode's information asynchronous with respect to the glock workqueue, which is another improvement that has been on the list for some time now. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/incore.h')
-rw-r--r--fs/gfs2/incore.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index cfebc1793574..dd7d0f8f3575 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -244,6 +244,7 @@ struct gfs2_inode {
244 struct gfs2_alloc *i_alloc; 244 struct gfs2_alloc *i_alloc;
245 u64 i_goal; /* goal block for allocations */ 245 u64 i_goal; /* goal block for allocations */
246 struct rw_semaphore i_rw_mutex; 246 struct rw_semaphore i_rw_mutex;
247 struct list_head i_trunc_list;
247 u32 i_entries; 248 u32 i_entries;
248 u32 i_diskflags; 249 u32 i_diskflags;
249 u8 i_height; 250 u8 i_height;
@@ -550,6 +551,8 @@ struct gfs2_sbd {
550 spinlock_t sd_quota_spin; 551 spinlock_t sd_quota_spin;
551 struct mutex sd_quota_mutex; 552 struct mutex sd_quota_mutex;
552 wait_queue_head_t sd_quota_wait; 553 wait_queue_head_t sd_quota_wait;
554 struct list_head sd_trunc_list;
555 spinlock_t sd_trunc_lock;
553 556
554 unsigned int sd_quota_slots; 557 unsigned int sd_quota_slots;
555 unsigned int sd_quota_chunks; 558 unsigned int sd_quota_chunks;