[Top] [All Lists]

[PATCH] Use xfs_d_alloc_anon for DM rdwr using handle code.

To: xfs-dev@xxxxxxx
Subject: [PATCH] Use xfs_d_alloc_anon for DM rdwr using handle code.
From: xaiki@xxxxxxx
Date: Fri, 2 May 2008 11:55:39 +1000
Cc: xfs@xxxxxxxxxxx, Niv Sardi <xaiki@xxxxxxxxxx>, Niv Sardi <xaiki@xxxxxxx>
In-reply-to: <1209693339-4861-2-git-send-email-xaiki@sgi.com>
References: <20080501070244.GH108924158@sgi.com> <1209693339-4861-1-git-send-email-xaiki@sgi.com> <1209693339-4861-2-git-send-email-xaiki@sgi.com>
Sender: xfs-bounce@xxxxxxxxxxx
From: Niv Sardi <xaiki@xxxxxxxxxx>

When doing invisible IO through the DMAPI we only require a handle, but
that doesn't give us a file descriptor that we require, before we used
to call d_alloc_annon() that created an annonymous disconnected but
hashed dentry, from which we extracted the file descriptor, if no one
else uses the dentry, the dput on fclose should unhash the dentry and
(if not used) tear appart the dentry, and call into xfs_inactive where
we will send the DESTROY EVENT. The issue was, that in some cases (as
the dentry was hashed) another thread could use the same dentry
inibiting the unhash on the first dput, and hence leaving that dentry on
the unused list for ever (or untill caches are dropped).

This uses the cuted down d_alloc_annon xfs implementation so that the dentry
is never hashed.

Signed-off-by: Niv Sardi <xaiki@xxxxxxx>
 fs/xfs/dmapi/xfs_dm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/dmapi/xfs_dm.c b/fs/xfs/dmapi/xfs_dm.c
index c4f57a9..5aa00a9 100644
--- a/fs/xfs/dmapi/xfs_dm.c
+++ b/fs/xfs/dmapi/xfs_dm.c
@@ -1126,7 +1126,7 @@ xfs_dm_rdwr(
-       dentry = d_alloc_anon(inode);
+       dentry = xfs_d_alloc_anon(inode);
        if (dentry == NULL) {
                return ENOMEM;

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