summaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_znode.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-02-16 09:51:44 -0800
committerBrian Behlendorf <[email protected]>2011-02-16 09:51:44 -0800
commitd8fd10545b677cb4b770674372c1e116b7c22c64 (patch)
tree5653b53ace6704abfeed07c8af6fe25156d3b932 /module/zfs/zfs_znode.c
parentd5674448094cec6eb3563afb63cc1e096bc5b280 (diff)
Fix FIFO and socket handling
Under Linux when creating a fifo or socket type device in the ZFS filesystem it's critical that the rdev is stored in a SA. This was already being correctly done for character and block devices, but that logic needed to be extended to include FIFOs and sockets. This patch takes care of device creation but a follow on patch may still be required to verify that the dev_t is being correctly packed/unpacked from the SA.
Diffstat (limited to 'module/zfs/zfs_znode.c')
-rw-r--r--module/zfs/zfs_znode.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
index 024668287..56ac2ab8c 100644
--- a/module/zfs/zfs_znode.c
+++ b/module/zfs/zfs_znode.c
@@ -586,7 +586,8 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr,
size = links = 0;
}
- if (S_ISBLK(vap->va_mode) || S_ISCHR(vap->va_mode))
+ if (S_ISBLK(vap->va_mode) || S_ISCHR(vap->va_mode) ||
+ S_ISFIFO(vap->va_mode) || S_ISSOCK(vap->va_mode))
rdev = zfs_expldev(vap->va_rdev);
parent = dzp->z_id;
@@ -677,10 +678,10 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr,
&empty_xattr, 8);
}
if (obj_type == DMU_OT_ZNODE ||
- (S_ISBLK(vap->va_mode) || S_ISCHR(vap->va_mode))) {
+ (S_ISBLK(vap->va_mode) || S_ISCHR(vap->va_mode) ||
+ S_ISFIFO(vap->va_mode) || S_ISSOCK(vap->va_mode))) {
SA_ADD_BULK_ATTR(sa_attrs, cnt, SA_ZPL_RDEV(zsb),
NULL, &rdev, 8);
-
}
if (obj_type == DMU_OT_ZNODE) {
SA_ADD_BULK_ATTR(sa_attrs, cnt, SA_ZPL_FLAGS(zsb),