xfs-masters
[Top] [All Lists]

[xfs-masters] [Bug 624] New: DM_EVENT_REMOVE does not include object mo

To: xfs-master@xxxxxxxxxxx
Subject: [xfs-masters] [Bug 624] New: DM_EVENT_REMOVE does not include object mode
From: bugzilla-daemon@xxxxxxxxxxx
Date: Wed, 12 Apr 2006 18:58:34 -0700
Reply-to: xfs-masters@xxxxxxxxxxx
Sender: xfs-masters-bounce@xxxxxxxxxxx
http://oss.sgi.com/bugzilla/show_bug.cgi?id=624

           Summary: DM_EVENT_REMOVE does not include object mode
           Product: Linux XFS
           Version: Current
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dmapi
        AssignedTo: xfs-master@xxxxxxxxxxx
        ReportedBy: kjamieson@xxxxxxxxxx


The DM_EVENT_REMOVE namespace event generated in xfs_remove and xfs_rmdir
currently passes 0 for the mode field.

According to the XDSM API
(http://www.opengroup.org/onlinepubs/9657099/chap3.htm) the remove event should
include the object's mode:

"mode - type of the object to be removed and is the same value as st_mode in
struct stat and dt_mode in struct dm_stat."


One practical reason why it is useful to have the mode included in
DM_EVENT_REMOVE is that vfs_rmdir drops the dentry to be removed before
xfs_rmdir gets called, so if a client application handling DM_EVENT_REMOVE for a
directory does a path_lookup on the object (e.g., by calling dm_path_to_handle)
it will deadlock on the parent directory inode mutex in real_lookup.

Passing S_IFDIR for the rmdir event is one ugly workaround for this particular
situation.

Index: fs/xfs/xfs_vnodeops.c
===================================================================
RCS file: /cvs/linux-2.6-xfs/fs/xfs/xfs_vnodeops.c,v
retrieving revision 1.669
diff -u -r1.669 xfs_vnodeops.c
--- fs/xfs/xfs_vnodeops.c       23 Mar 2006 02:48:21 -0000      1.669
+++ fs/xfs/xfs_vnodeops.c       13 Apr 2006 01:49:58 -0000
@@ -3002,7 +3002,7 @@
                error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE,
                                        dir_vp, DM_RIGHT_NULL,
                                        NULL, DM_RIGHT_NULL,
-                                       name, NULL, 0, 0, 0);
+                                       name, NULL, S_IFDIR, 0, 0);
                if (error)
                        return XFS_ERROR(error);
        }

-- 
Configure bugmail: http://oss.sgi.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


<Prev in Thread] Current Thread [Next in Thread>
  • [xfs-masters] [Bug 624] New: DM_EVENT_REMOVE does not include object mode, bugzilla-daemon <=