xfs
[Top] [All Lists]

[PATCH 3/9] xfs: switch to NOFS allocation under i_lock in xfs_da_state_

To: xfs@xxxxxxxxxxx
Subject: [PATCH 3/9] xfs: switch to NOFS allocation under i_lock in xfs_da_state_alloc
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 25 Aug 2009 14:21:37 -0400
References: <20090825182134.299870049@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.47-1
xfs_da_state_alloc is always called with i_lock held, but i_lock is taken in
reclaim context so all allocations under it must avoid recursions into the
filesystem.

Reported by the new reclaim context tracing in lockdep.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: linux-2.6/fs/xfs/xfs_da_btree.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_da_btree.c        2009-07-10 13:05:24.812364541 
+0200
+++ linux-2.6/fs/xfs/xfs_da_btree.c     2009-07-10 13:16:00.834365485 +0200
@@ -2201,7 +2201,7 @@ kmem_zone_t *xfs_dabuf_zone;              /* dabuf z
 xfs_da_state_t *
 xfs_da_state_alloc(void)
 {
-       return kmem_zone_zalloc(xfs_da_state_zone, KM_SLEEP);
+       return kmem_zone_zalloc(xfs_da_state_zone, KM_NOFS);
 }
 
 /*

<Prev in Thread] Current Thread [Next in Thread>