Bug 2109420

Summary: rpc-pipefs-generator fails when different pipefs-directory value specified
Product: Red Hat Enterprise Linux 9 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.1CC: xzhou
Target Milestone: rcKeywords: Patch, Regression, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-2.5.4-12.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 11:22:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yongcheng Yang 2022-07-21 07:49:55 UTC
Description of problem:
It turns out Bug 2106896 introduce a regression failure that we can't set another pipefs directory now.

E.g.
[root@hp-dl385pg8-09 ~]# cat /etc/nfs.conf
[general]
 pipefs-directory=/run/rpc_pipefs
[root@hp-dl385pg8-09 ~]# systemctl daemon-reload
[root@hp-dl385pg8-09 ~]# systemctl restart rpc_pipefs.target
Failed to restart rpc_pipefs.target: Unit run-rpc_pipefs.mount not found.

Version-Release number of selected component (if applicable):
fail nfs-utils-2.5.4-11.el9.x86_64
pass nfs-utils-2.5.4-10.el9.x86_64

How reproducible:
always

Steps to Reproduce:
1. Edit file /etc/nfs.conf to config another pipefs-directory value
2. systemctl daemon-reload
3. systemctl restart rpc_pipefs.target
Will get failure message.

Actual results:
[root@hp-dl385pg8-09 ~]# cat /etc/nfs.conf
[general]
 pipefs-directory=/run/rpc_pipefs
[root@hp-dl385pg8-09 ~]# systemctl daemon-reload
[root@hp-dl385pg8-09 ~]# systemctl restart rpc_pipefs.target
Failed to restart rpc_pipefs.target: Unit run-rpc_pipefs.mount not found.
[root@hp-dl385pg8-09 ~]# >/var/log/messages
[root@hp-dl385pg8-09 ~]# systemctl restart rpc_pipefs.target
Failed to restart rpc_pipefs.target: Unit run-rpc_pipefs.mount not found.
[root@hp-dl385pg8-09 ~]# cat /var/log/messages
[root@hp-dl385pg8-09 ~]#

Expected results:
[root@hp-dl385pg8-09 ~]# rpm -q nfs-utils libnfsidmap
nfs-utils-2.5.4-10.el9.x86_64
libnfsidmap-2.5.4-11.el9.x86_64
[root@hp-dl385pg8-09 ~]#
[root@hp-dl385pg8-09 ~]#
[root@hp-dl385pg8-09 ~]# cat /etc/nfs.conf
[general]
 pipefs-directory=/run/rpc_pipefs
[root@hp-dl385pg8-09 ~]# systemctl daemon-reload
[root@hp-dl385pg8-09 ~]# systemctl restart rpc_pipefs.target     <<<< success
[root@hp-dl385pg8-09 ~]# grep sunrpc /proc/mounts
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
sunrpc /run/rpc_pipefs rpc_pipefs rw,relatime 0 0
[root@hp-dl385pg8-09 ~]# systemctl cat run-rpc_pipefs.mount
# /run/systemd/generator/run-rpc_pipefs.mount
# Automatically generated by rpc-pipefs-generator

[Unit]
Description=RPC Pipe File System
DefaultDependencies=no
After=systemd-tmpfiles-setup.service
Conflicts=umount.target

[Mount]
What=sunrpc
Where=/run/rpc_pipefs
Type=rpc_pipefs
[root@hp-dl385pg8-09 ~]# rpm -q nfs-utils
nfs-utils-2.5.4-10.el9.x86_64

Additional info:

Comment 1 Steve Dickson 2022-07-22 14:53:52 UTC
commit 36ce9a29d34e48e1fb5af80ec5258c342e6557df (HEAD -> master, origin/master, origin/HEAD)
Author: Steve Dickson <steved>
Date:   Thu Jul 21 15:11:17 2022 -0400

    rpc-pipefs-generator: allocate enough space for pipefs-directory buffer
    
    Commit 7f8463fe fixed a warning but introduce
    a regression by not allocating enough space
    for the pipefs-directory buffer when it is
    not the default.
    
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2106896
    Signed-off-by: Steve Dickson <steved>

Comment 2 Yongcheng Yang 2022-07-25 03:57:43 UTC
Verified in nfs-utils-2.5.4-12.el9

https://beaker.engineering.redhat.com/recipes/12334820#task147821672
---
[21:32:50 root@ ~~]# echo '[general]' > /etc/nfs.conf
[21:32:50 root@ ~~]# echo 'pipefs-directory=/run/rpc_pipefs' >> /etc/nfs.conf
[21:32:50 root@ ~~]# systemctl daemon-reload
[21:32:50 root@ ~~]# systemctl restart rpc_pipefs.target
[21:32:50 root@ ~~]# systemctl cat rpc_pipefs.target
# /run/systemd/generator/rpc_pipefs.target
# Automatically generated by rpc-pipefs-generator

[Unit]
Requires=run-rpc_pipefs.mount
After=run-rpc_pipefs.mount
[21:32:50 root@ ~~]# cat /proc/mounts | grep ^sunrpc
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
sunrpc /run/rpc_pipefs rpc_pipefs rw,relatime 0 0


Compared with previous nfs-utils-2.5.4-11.el9

[21:01:22 root@ ~~]# echo '[general]' > /etc/nfs.conf
[21:01:22 root@ ~~]# echo 'pipefs-directory=/run/rpc_pipefs' >> /etc/nfs.conf
[21:01:22 root@ ~~]# systemctl daemon-reload
[21:01:22 root@ ~~]# systemctl restart rpc_pipefs.target
Failed to restart rpc_pipefs.target: Unit run-rpc_pipefs.mount not found.

Comment 6 errata-xmlrpc 2022-11-15 11:22:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nfs-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8376