[Top] [All Lists]

[PATCH 5/9] xfs: switch to NOFS allocation under i_lock in xfs_dir_ciloo

To: xfs@xxxxxxxxxxx
Subject: [PATCH 5/9] xfs: switch to NOFS allocation under i_lock in xfs_dir_cilookup_result
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Sat, 18 Jul 2009 18:14:57 -0400
Cc: sage@xxxxxxxxxxxx
References: <20090718221452.594956000@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.47-1
xfs_dir_cilookup_result 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

Reported by the new reclaim context tracing in lockdep.

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

Index: linux-2.6/fs/xfs/xfs_dir2.c
--- linux-2.6.orig/fs/xfs/xfs_dir2.c    2009-07-10 13:05:24.817364338 +0200
+++ linux-2.6/fs/xfs/xfs_dir2.c 2009-07-10 13:16:00.834365485 +0200
@@ -256,7 +256,7 @@ xfs_dir_cilookup_result(
                                        !(args->op_flags & XFS_DA_OP_CILOOKUP))
                return EEXIST;
-       args->value = kmem_alloc(len, KM_MAYFAIL);
+       args->value = kmem_alloc(len, KM_NOFS | KM_MAYFAIL);
        if (!args->value)
                return ENOMEM;

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