From d8fd10545b677cb4b770674372c1e116b7c22c64 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 16 Feb 2011 09:51:44 -0800 Subject: 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. --- module/zfs/zfs_znode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/zfs') 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), -- cgit v1.2.3