Linux NFS development
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: nfs@lists.sourceforge.net
Subject: [PATCH] nfs-utils 7 of 10 - Changed mountd to use stat64()
Date: Fri, 23 Sep 2005 10:48:24 -0400	[thread overview]
Message-ID: <433415B8.6090708@RedHat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: nfs-utils-1.0.7-mountd-stat64.patch --]
[-- Type: text/x-patch, Size: 2242 bytes --]

Changed mountd to use stat64() (bz 165062)
Which fixed the following error:
rpc.mountd: can't stat exported dir /mnt/bigfile: Value too large 
for defined data type

I wonder if it would be better just to make mountd a 64bit
application by compiling with -D_FILE_OFFSET_BITS=64?

Details can be found in:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=165062

Signed-off-by: Steve Dickson <steved@redhat.com>
---------
--- nfs-utils-1.0.7/utils/mountd/mountd.c.orig	2005-08-02 10:25:34.000000000 -0400
+++ nfs-utils-1.0.7/utils/mountd/mountd.c	2005-08-16 04:01:27.000000000 -0400
@@ -187,7 +187,7 @@ mount_pathconf_2_svc(struct svc_req *rqs
 {
 	struct sockaddr_in *sin
 		= (struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
-	struct stat	stb;
+	struct stat64	stb;
 	nfs_export	*exp;
 	char		rpath[MAXPATHLEN+1];
 	char		*p = *path;
@@ -209,7 +209,7 @@ mount_pathconf_2_svc(struct svc_req *rqs
 	/* Now authenticate the intruder... */
 	if (!(exp = auth_authenticate("pathconf", sin, p))) {
 		return 1;
-	} else if (stat(p, &stb) < 0) {
+	} else if (stat64(p, &stb) < 0) {
 		xlog(L_WARNING, "can't stat exported dir %s: %s",
 				p, strerror(errno));
 		export_reset (exp);
@@ -263,7 +263,7 @@ get_rootfh(struct svc_req *rqstp, dirpat
 {
 	struct sockaddr_in *sin =
 		(struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
-	struct stat	stb, estb;
+	struct stat64	stb, estb;
 	nfs_export	*exp;
 	char		rpath[MAXPATHLEN+1];
 	char		*p = *path;
@@ -283,7 +283,7 @@ get_rootfh(struct svc_req *rqstp, dirpat
 	/* Now authenticate the intruder... */
 	if (!(exp = auth_authenticate("mount", sin, p))) {
 		*error = NFSERR_ACCES;
-	} else if (stat(p, &stb) < 0) {
+	} else if (stat64(p, &stb) < 0) {
 		xlog(L_WARNING, "can't stat exported dir %s: %s",
 				p, strerror(errno));
 		if (errno == ENOENT)
@@ -293,7 +293,7 @@ get_rootfh(struct svc_req *rqstp, dirpat
 	} else if (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) {
 		xlog(L_WARNING, "%s is not a directory or regular file", p);
 		*error = NFSERR_NOTDIR;
-	} else if (stat(exp->m_export.e_path, &estb) < 0) {
+	} else if (stat64(exp->m_export.e_path, &estb) < 0) {
 		xlog(L_WARNING, "can't stat export point %s: %s",
 		     p, strerror(errno));
 		*error = NFSERR_NOENT;

                 reply	other threads:[~2005-09-23 14:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=433415B8.6090708@RedHat.com \
    --to=steved@redhat.com \
    --cc=nfs@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox