From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew Gray" <7114@blargh.com> Subject: Patch to mountd to mount files > 2GB Date: Tue, 13 Jan 2004 21:19:16 -0800 Sender: nfs-admin@lists.sourceforge.net Message-ID: <01c401c3da5d$f50dc580$2a00a8c0@phoenix> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01C1_01C3DA1A.E62560C0" Return-path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.11] helo=sc8-sf-mx1.sourceforge.net) by sc8-sf-list2.sourceforge.net with esmtp (Exim 4.30) id 1AgdR5-0000pA-EP for nfs@lists.sourceforge.net; Tue, 13 Jan 2004 21:19:23 -0800 Received: from wsip-24-234-142-86.lv.lv.cox.net ([24.234.142.86] helo=blargh.com) by sc8-sf-mx1.sourceforge.net with esmtp (TLSv1:AES256-SHA:256) (Exim 4.30) id 1AgdR4-0005A5-RL for nfs@lists.sourceforge.net; Tue, 13 Jan 2004 21:19:23 -0800 To: nfs@lists.sourceforge.net Errors-To: nfs-admin@lists.sourceforge.net List-Unsubscribe: , List-Id: Discussion of NFS under Linux development, interoperability, and testing. List-Post: List-Help: List-Subscribe: , List-Archive: This is a multi-part message in MIME format. ------=_NextPart_000_01C1_01C3DA1A.E62560C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Greetings all, If this has been problem/solution has been posted before, please = disregard :) I'm using NFS to serve out FLAR archives to Sun machines. These files = are > 2GB, and the auto-installer for the Sun boxes mount the files, not the directories. mountd was refusing to authenticate these otherwise legit requests because the stat() call was bombing due the filesize being too large. I hacked up the quick diff below that fixed the problem. The = files transfer correctly and completely, but I admit I haven't performed = further testing. diff -u nfs-utils-1.0.6-orig/utils/mountd/mountd.c nfs-utils-1.0.6/utils/mountd/mountd.c --- nfs-utils-1.0.6-orig/utils/mountd/mountd.c Fri Sep 12 15:14:16 2003 +++ nfs-utils-1.0.6/utils/mountd/mountd.c Tue Jan 13 20:11:49 2004 @@ -176,7 +176,7 @@ { struct sockaddr_in *sin =3D (struct sockaddr_in *) = svc_getcaller(rqstp->rq_xprt); - struct stat stb; + struct stat64 stb; nfs_export *exp; char rpath[MAXPATHLEN+1]; char *p =3D *path; @@ -198,7 +198,7 @@ /* Now authenticate the intruder... */ if (!(exp =3D 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); @@ -248,7 +248,7 @@ { struct sockaddr_in *sin =3D (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 =3D *path; @@ -268,7 +268,7 @@ /* Now authenticate the intruder... */ if (!(exp =3D auth_authenticate("mount", sin, p))) { *error =3D 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 =3D=3D ENOENT) @@ -278,7 +278,7 @@ } 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 =3D 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 =3D NFSERR_NOENT; ------=_NextPart_000_01C1_01C3DA1A.E62560C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Greetings all,

If this has been = problem/solution=20 has been posted before, please disregard
:)

I'm using NFS to = serve out=20 FLAR archives to Sun machines.  These files are >
2GB, and = the=20 auto-installer for the Sun boxes mount the files, not = the
directories. =20 mountd was refusing to authenticate these otherwise legit
requests = because=20 the stat() call was bombing due the filesize being too
large.  I = hacked=20 up the quick diff below that fixed the problem.  The = files
transfer=20 correctly and completely, but I admit I haven't performed=20 further
testing.

diff -u=20 nfs-utils-1.0.6-orig/utils/mountd/mountd.c
nfs-utils-1.0.6/utils/mount= d/mountd.c
---=20 nfs-utils-1.0.6-orig/utils/mountd/mountd.c  Fri Sep 12 15:14:16 = 2003
+++=20 nfs-utils-1.0.6/utils/mountd/mountd.c      = Tue=20 Jan 13 20:11:49 2004
@@ -176,7 +176,7=20 @@
 {
        struct = sockaddr_in=20 *sin
           = ;    =20 =3D (struct sockaddr_in *)=20 svc_getcaller(rqstp->rq_xprt);
-      = ;=20 struct stat    =20 stb;
+       struct stat64  =20 stb;
       =20 nfs_export     =20 *exp;
       =20 char           =20 rpath[MAXPATHLEN+1];
       =20 char            = *p =3D=20 *path;
@@ -198,7 +198,7 = @@
        /*=20 Now authenticate the intruder...=20 */
        if (!(exp =3D=20 auth_authenticate("pathconf", sin, p)))=20 {
           &n= bsp;   =20 return 1;
-       } else if (stat(p, = &stb)=20 < 0) {
+       } else if (stat64(p,=20 &stb) < 0)=20 {
           &n= bsp;   =20 xlog(L_WARNING, "can't stat exported dir %s:=20 %s",
           = ;            =         =20 p,=20 strerror(errno));
        &nbs= p;      =20 export_reset (exp);
@@ -248,7 +248,7=20 @@
 {
        struct = sockaddr_in=20 *sin=20 =3D
           =     =20 (struct sockaddr_in *)=20 svc_getcaller(rqstp->rq_xprt);
-      = ;=20 struct stat     stb,=20 estb;
+       struct stat64   = stb,=20 estb;
       =20 nfs_export     =20 *exp;
       =20 char           =20 rpath[MAXPATHLEN+1];
       =20 char            = *p =3D=20 *path;
@@ -268,7 +268,7 = @@
        /*=20 Now authenticate the intruder...=20 */
        if (!(exp =3D=20 auth_authenticate("mount", sin, p)))=20 {
           &n= bsp;   =20 *error =3D NFSERR_ACCES;
-       } else = if=20 (stat(p, &stb) < 0) {
+       } = else if=20 (stat64(p, &stb) < 0)=20 {
           &n= bsp;   =20 xlog(L_WARNING, "can't stat exported dir %s:=20 %s",
           = ;            =         =20 p,=20 strerror(errno));
        &nbs= p;      =20 if (errno =3D=3D ENOENT)
@@ -278,7 +278,7=20 @@
        } else if=20 (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode))=20 {
           &n= bsp;   =20 xlog(L_WARNING, "%s is not a directory or regular file",=20 p);
           =     =20 *error =3D NFSERR_NOTDIR;
-       } = else if=20 (stat(exp->m_export.e_path, &estb) < 0)=20 {
+       } else if=20 (stat64(exp->m_export.e_path, &estb) < 0)=20 {
           &n= bsp;   =20 xlog(L_WARNING, "can't stat export point %s:=20 %s",
           = ;         =20 p,=20 strerror(errno));
        &nbs= p;      =20 *error =3D NFSERR_NOENT;
 
------=_NextPart_000_01C1_01C3DA1A.E62560C0-- ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs