diff mbox series

[2/3] common/populate: create fifos when pre-populating filesystems

Message ID 161647319358.3429609.6818899550213439595.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series populate: fix a few bugs with fs pre-population | expand

Commit Message

Darrick J. Wong March 23, 2021, 4:19 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Create fifos when populating the scratch filesystem for completeness.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/populate |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Christoph Hellwig March 24, 2021, 6:05 p.m. UTC | #1
On Mon, Mar 22, 2021 at 09:19:53PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Create fifos when populating the scratch filesystem for completeness.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/common/populate b/common/populate
index 8f42a528..c01b7e0e 100644
--- a/common/populate
+++ b/common/populate
@@ -231,6 +231,7 @@  _scratch_xfs_populate() {
 	echo "+ special"
 	mknod "${SCRATCH_MNT}/S_IFCHR" c 1 1
 	mknod "${SCRATCH_MNT}/S_IFBLK" b 1 1
+	mknod "${SCRATCH_MNT}/S_IFIFO" p
 
 	# special file with an xattr
 	setfacl -P -m u:nobody:r ${SCRATCH_MNT}/S_IFCHR
@@ -403,6 +404,7 @@  _scratch_ext4_populate() {
 	echo "+ special"
 	mknod "${SCRATCH_MNT}/S_IFCHR" c 1 1
 	mknod "${SCRATCH_MNT}/S_IFBLK" b 1 1
+	mknod "${SCRATCH_MNT}/S_IFIFO" p
 
 	# special file with an xattr
 	setfacl -P -m u:nobody:r ${SCRATCH_MNT}/S_IFCHR
@@ -580,6 +582,7 @@  _scratch_xfs_populate_check() {
 	extents_slink="$(__populate_find_inode "${SCRATCH_MNT}/S_IFLNK.FMT_EXTENTS")"
 	bdev="$(__populate_find_inode "${SCRATCH_MNT}/S_IFBLK")"
 	cdev="$(__populate_find_inode "${SCRATCH_MNT}/S_IFCHR")"
+	fifo="$(__populate_find_inode "${SCRATCH_MNT}/S_IFIFO")"
 	local_attr="$(__populate_find_inode "${SCRATCH_MNT}/ATTR.FMT_LOCAL")"
 	leaf_attr="$(__populate_find_inode "${SCRATCH_MNT}/ATTR.FMT_LEAF")"
 	node_attr="$(__populate_find_inode "${SCRATCH_MNT}/ATTR.FMT_NODE")"
@@ -605,6 +608,7 @@  _scratch_xfs_populate_check() {
 	__populate_check_xfs_dformat "${btree_dir}" "btree"
 	__populate_check_xfs_dformat "${bdev}" "dev"
 	__populate_check_xfs_dformat "${cdev}" "dev"
+	__populate_check_xfs_dformat "${fifo}" "dev"
 	__populate_check_xfs_attr "${local_attr}" "local"
 	__populate_check_xfs_attr "${leaf_attr}" "leaf"
 	__populate_check_xfs_attr "${node_attr}" "node"