xfs
[Top] [All Lists]

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

To: xfs@xxxxxxxxxxx
Subject: [PATCH 9/9] xfs: switch to NOFS allocation under i_lock in xfs_attr_rmtval_get
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 25 Aug 2009 14:21:43 -0400
References: <20090825182134.299870049@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.47-1
xfs_attr_rmtval_get 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.


Index: linux-2.6/fs/xfs/xfs_attr.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_attr.c    2009-07-18 22:34:08.947532301 +0200
+++ linux-2.6/fs/xfs/xfs_attr.c 2009-07-18 22:35:44.786660003 +0200
@@ -2010,7 +2010,9 @@ xfs_attr_rmtval_get(xfs_da_args_t *args)
                        dblkno = XFS_FSB_TO_DADDR(mp, map[i].br_startblock);
                        blkcnt = XFS_FSB_TO_BB(mp, map[i].br_blockcount);
                        error = xfs_read_buf(mp, mp->m_ddev_targp, dblkno,
-                                            blkcnt, XFS_BUF_LOCK, &bp);
+                                            blkcnt,
+                                            XFS_BUF_LOCK | XBF_DONT_BLOCK,
+                                            &bp);
                        if (error)
                                return(error);
 

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