Commit 17370097 authored by Vlad Apostolov's avatar Vlad Apostolov Committed by Tim Shimmin

[XFS] pass file mode on DMAPI remove events

SGI-PV: 953687
SGI-Modid: xfs-linux-melb:xfs-kern:26639a
Signed-off-by: default avatarVlad Apostolov <vapo@sgi.com>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent 745b1f47
...@@ -2366,10 +2366,15 @@ xfs_remove( ...@@ -2366,10 +2366,15 @@ xfs_remove(
namelen = VNAMELEN(dentry); namelen = VNAMELEN(dentry);
if (!xfs_get_dir_entry(dentry, &ip)) {
dm_di_mode = ip->i_d.di_mode;
IRELE(ip);
}
if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) {
error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp, error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp,
DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL,
name, NULL, 0, 0, 0); name, NULL, dm_di_mode, 0, 0);
if (error) if (error)
return error; return error;
} }
...@@ -2995,7 +3000,7 @@ xfs_rmdir( ...@@ -2995,7 +3000,7 @@ xfs_rmdir(
int cancel_flags; int cancel_flags;
int committed; int committed;
bhv_vnode_t *dir_vp; bhv_vnode_t *dir_vp;
int dm_di_mode = 0; int dm_di_mode = S_IFDIR;
int last_cdp_link; int last_cdp_link;
int namelen; int namelen;
uint resblks; uint resblks;
...@@ -3010,11 +3015,16 @@ xfs_rmdir( ...@@ -3010,11 +3015,16 @@ xfs_rmdir(
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
namelen = VNAMELEN(dentry); namelen = VNAMELEN(dentry);
if (!xfs_get_dir_entry(dentry, &cdp)) {
dm_di_mode = cdp->i_d.di_mode;
IRELE(cdp);
}
if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) {
error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE,
dir_vp, DM_RIGHT_NULL, dir_vp, DM_RIGHT_NULL,
NULL, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL,
name, NULL, 0, 0, 0); name, NULL, dm_di_mode, 0, 0);
if (error) if (error)
return XFS_ERROR(error); return XFS_ERROR(error);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment