RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1296791 - Loop back device mounted from nfs share doesn't get mounted without _netdev option
Summary: Loop back device mounted from nfs share doesn't get mounted without _netdev o...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1298243 1420851
TreeView+ depends on / blocked
 
Reported: 2016-01-08 04:07 UTC by VIKRANT
Modified: 2019-11-14 07:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-20 14:21:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description VIKRANT 2016-01-08 04:07:11 UTC
Description of problem:
On rhel nfs client loop mount of the image present in nfs share is not getting mounted with _netdev option.

Version-Release number of selected component (if applicable):
3.10.0-327.4.4.el7.x86_64  (RHEL 7.2)

How reproducible:
Everytime

Steps to Reproduce:
1. Export a nfs share from RHEL machine containing image.
2. Mount that share on nfs client and add the entry in /etc/fstab with _netdev option.
3. Loop mount the image present in share on nfs client and add the entry for same /etc/fstab without _netdev option and with x-systemd.requires for original nfs filesystem mounted in Step 2.



Actual results:
Without _netdev option for the loop 

Expected results:
As we have added dependency for original nfs filesystem in loop back device it should get mounted with _netdev option.


Additional info:
Workaround is to add _netdev option for loop mount device.


==> Working Configuration 

10.65.6.158:/myexport /mnt/install nfs ro,_netdev 0 0
/mnt/install/rhel-server-7.1-x86_64-dvd.iso /repodvd iso9660 loop,ro,x-systemd.requires=mnt-install.mount,_netdev 0 0

==> Not-working configuration.

10.65.6.158:/myexport /mnt/install nfs ro,_netdev 0 0
/mnt/install/rhel-server-7.1-x86_64-dvd.iso /repodvd iso9660 loop,ro,x-systemd.requires=mnt-install.mount 0 0

Comment 2 VIKRANT 2016-01-11 03:51:41 UTC
Typo In Description of the Bug. It should be read as : 

On rhel nfs client loop mount of the image present in nfs share is not getting mounted **WITHOUT** _netdev option.

Comment 3 Lukáš Nykrýn 2016-01-12 14:09:23 UTC
Can you please add debug to kernel cmdline, reproduce the issue and post here output of journalctl -b?

Comment 5 Lukáš Nykrýn 2016-01-13 07:31:58 UTC
Yes, or you can just add thet directly during boot in grub.

Comment 16 Kyle Walker 2019-06-20 14:21:59 UTC
Looking at the latest upstream fstab-generator, setting dependencies happens in the following:

                if (streq(me->mnt_type, "swap"))
                        k = add_swap(what, me,
                                     makefs*MAKEFS | growfs*GROWFS | noauto*NOAUTO | nofail*NOFAIL);
                else {
                        bool automount;
                        const char *post;

                        automount = fstab_test_option(me->mnt_opts,
                                                      "comment=systemd.automount\0"
                                                      "x-systemd.automount\0");
                        if (initrd)
                                post = SPECIAL_INITRD_FS_TARGET;
                        else if (mount_is_network(me))
                                post = SPECIAL_REMOTE_FS_TARGET;
                        else
                                post = SPECIAL_LOCAL_FS_TARGET;

                        k = add_mount(arg_dest,
                                      what,
                                      canonical_where ?: where,
                                      canonical_where ? where: NULL,
                                      me->mnt_type,
                                      me->mnt_opts,
                                      me->mnt_passno,
                                      makefs*MAKEFS | growfs*GROWFS | noauto*NOAUTO | nofail*NOFAIL | automount*AUTOMOUNT,
                                      post,
                                      fstab_path);
                }

Note that the "mount_is_network(me)" operation determines if the mount is to be tied to either the local-fs.target or remote-fs.target. That function evaluates as:

static bool mount_is_network(struct mntent *me) {
        assert(me);

        return fstab_test_option(me->mnt_opts, "_netdev\0") ||
               fstype_is_network(me->mnt_type);
}

And:

bool fstype_is_network(const char *fstype) {
        const char *x;

        x = startswith(fstype, "fuse.");
        if (x) 
                fstype = x;

        return STR_IN_SET(fstype,
                          "afs",
                          "cifs",
                          "smbfs",
                          "sshfs",
                          "ncpfs",
                          "ncp",
                          "nfs",
                          "nfs4",
                          "gfs",
                          "gfs2",
                          "glusterfs",
                          "pvfs2", /* OrangeFS */
                          "ocfs2",
                          "lustre");
}       


In lieu of setting "_netdev", the mechanism needed here would be a feature enhancement. Any feature of this type would have to be upstream first, to add awareness of parent filesystems. In other words, in the instance that you are mounting:

    parent /parent
    child  /parent/child

The expectation would be that if the parent filesystem is a network-requiring filesystem, then the child would not have a Before=local-fs.target directive. It would instead get a Before=remote-fs.target. I am more than a bit concerned that this implicit behaviour is much less ideal over the explicit use of the "_netdev" option. It would then result in odd child mount behaviours in the event that an incorrect "_netdev" configuration option is used in a parent mount.

As a result of the above state of the implementation, and that the initial investigation that started this bug report has been closed, I am closing this bug as WONTFIX in the RHEL 7 stream. In the event that demand is found to continue pursuit of this type of change, please open a subsequent bug report for RHEL 8 and reference this previous instance. From there, the guidance would be to file a request with the upstream project and pursue a solution there.


Note You need to log in before you can comment on or make changes to this bug.