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 1007627 - [exportfs] Validate export entry fail. And when start nfs server, should not export the invalid entry;
Summary: [exportfs] Validate export entry fail. And when start nfs server, should not ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: nfs-utils
Version: 6.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
URL:
Whiteboard:
Depends On: 1007626 1007628
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-13 02:16 UTC by JianHong Yin
Modified: 2015-12-19 18:03 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of: 1007626
Environment:
Last Closed: 2015-12-19 18:03:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description JianHong Yin 2013-09-13 02:16:19 UTC
+++ This bug was initially created as a clone of Bug #1007626 +++

Description of problem:
when start nfs server, we should verify the export entries:
  -when I export an directory in tmpfs without fsid= specified,
  -I can export successfuly, * but can not mount it from client.
  --the server log indicate: "Cannot export $dir, possibly unsupported filesystem or fsid= required"
  -We think that, exportfs should verify the export entries, if invalid then tell user that's invalid, cannot export

Version-Release number of selected component (if applicable):
all version in RHEL5.9 5.10 6.x 7.0

How reproducible:
100%

Steps to Reproduce:
0. backup your /etc/exports
1. echo "/dev/shm  *(ro)" >/etc/exports
2. service nfs restart
3. exportfs   or  showmount -e

Actual results:
service nfs restart           ok
exportfs output:
/dev/shm      <world>

Expected results:
service nfs restart           should output error/warn: 
and should not export success, exportfs no output

Additional info:

Comment 2 JianHong Yin 2013-09-13 12:30:08 UTC
Debug, and review the code of exportfs,
find that: this is a bug of exportfs(also about kernel):

static int test_export(char *path, int with_fsid)
{
        char buf[1024];
        int fd, n;

        sprintf(buf, "-test-client- %s 3 %d -1 -1 0\n",
                path,
                with_fsid ? NFSEXP_FSID : 0);
        fd = open("/proc/net/rpc/nfsd.export/channel", O_WRONLY);
        if (fd < 0)
                return 0;
        n = write(fd, buf, strlen(buf));
        close(fd);
        if (n < 0)
                return 0;
        return 1;
}

1. if the path is an tmpfs(no uuid), and with_fsid==0,
this function test_export still return 1 (write success). that's wrong.

2. and another problem: validate_export() just generate log and return void.
We think that validate_export() should return an int value to indicate whether the path can export. And in export_all(), should not export the path if invalid;

static void
export_all(int verbose)
{
        nfs_export      *exp;
        int             i;

        for (i = 0; i < MCL_MAXTYPES; i++) {
                for (exp = exportlist[i].p_head; exp; exp = exp->m_next) {
                        if (verbose)
                                printf("exporting %s:%s\n",
                                       exp->m_client->m_hostname,
                                       exp->m_export.e_path);
                        exp->m_xtabent = 1;
                        exp->m_mayexport = 1;
                        exp->m_changed = 1;
                        exp->m_warned = 0;
                        validate_export(exp);
                }
        }
}


static void <<<- should return int value to indicate whether the path can export
validate_export(nfs_export *exp)
{

Comment 3 JianHong Yin 2013-09-14 06:52:43 UTC
#BEGIN
--- exportfs.c	2013-06-06 15:12:58.881567360 +0800
+++ exportfs.c.new	2013-09-14 14:50:56.719877598 +0800
@@ -475,6 +475,9 @@ validate_export(nfs_export *exp)
 			xlog(L_ERROR, "%s does not support NFS export", path);
 		return;
 
+	} else {
+		xlog(L_ERROR, "Assert: test_export() %s fail", path);
+		return;
 	}
 }

#END

this patch could avoid the test_export work fail.

Comment 4 RHEL Program Management 2013-10-14 02:12:38 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 6 Steve Dickson 2015-12-19 18:03:37 UTC
(In reply to Yin.JianHong from comment #0)
> +++ This bug was initially created as a clone of Bug #1007626 +++
> 
>
This was closed as WONTFIX so I'm going to do wit this one.


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