xfs
[Top] [All Lists]

[PATCH] Unlock inode before calling xfs_idestroy()

To: xfs-oss <xfs@xxxxxxxxxxx>, xfs-dev <xfs-dev@xxxxxxx>
Subject: [PATCH] Unlock inode before calling xfs_idestroy()
From: Lachlan McIlroy <lachlan@xxxxxxx>
Date: Fri, 19 Sep 2008 13:15:08 +1000
Reply-to: lachlan@xxxxxxx
User-agent: Thunderbird 2.0.0.16 (X11/20080707)
Lock debugging reported the ilock was being destroyed
without being unlocked.

--- a/fs/xfs/xfs_iget.c 2008-09-19 13:03:57.000000000 +1000
+++ b/fs/xfs/xfs_iget.c 2008-09-19 13:12:38.000000000 +1000
@@ -214,6 +214,7 @@ finish_inode:
                xfs_ilock(ip, lock_flags);

        if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) {
+               xfs_iunlock(ip, lock_flags);
                xfs_idestroy(ip);
                xfs_put_perag(mp, pag);
                return ENOENT;
@@ -224,6 +225,7 @@ finish_inode:
         * write spinlock.
         */
        if (radix_tree_preload(GFP_KERNEL)) {
+               xfs_iunlock(ip, lock_flags);
                xfs_idestroy(ip);
                delay(1);
                goto again;
@@ -239,6 +241,7 @@ finish_inode:
                BUG_ON(error != -EEXIST);
                write_unlock(&pag->pag_ici_lock);
                radix_tree_preload_end();
+               xfs_iunlock(ip, lock_flags);
                xfs_idestroy(ip);
                XFS_STATS_INC(xs_ig_dup);
                goto again;

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