public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* How to change the FSINFO for nfsd?
@ 2008-05-08 17:05 P.V.Anthony
  2008-05-09  4:22 ` J. Bruce Fields
  0 siblings, 1 reply; 11+ messages in thread
From: P.V.Anthony @ 2008-05-08 17:05 UTC (permalink / raw)
  To: linux-kernel

Hi,

Currently a gentoo linux server is used as a nfs server for some Mac OS
X clients. These Mac OS X clients are doing video editing.

Currently the video are captured directly to the NFS mounts.

Here is the problem. The video files are broken into 2GB files. This
because the video editing software(Final Cut Pro) breaks the files into
2GB sizes. It does not seem that the Mac OS X is not doing the breaking
up of files. It is the video editing software.

Some commercial company found an interesting behaviour. All the Mac OS X
NFS server FSINFO response in which the max file size is set to 'FFFF
FFFF FFFF FFFF' (all '1's).

The link about the above information can be found at this link below.
Read towards the bottom of the link.
http://forums.creativecow.net/thread/8/975362

I really would like to know where to change in the NFS source code so
that the FSINFO response from the server in which the max file size is
set to 'FFFF FFFF FFFF FFFF' (all '1's).

P.V.Anthony



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change the FSINFO for nfsd?
  2008-05-08 17:05 How to change the FSINFO for nfsd? P.V.Anthony
@ 2008-05-09  4:22 ` J. Bruce Fields
  2008-05-11 16:44   ` P.V.Anthony
  2008-05-17 17:57   ` Solved - " P.V.Anthony
  0 siblings, 2 replies; 11+ messages in thread
From: J. Bruce Fields @ 2008-05-09  4:22 UTC (permalink / raw)
  To: P.V.Anthony; +Cc: linux-kernel

On Fri, May 09, 2008 at 01:05:17AM +0800, P.V.Anthony wrote:
> Hi,
> 
> Currently a gentoo linux server is used as a nfs server for some Mac OS
> X clients. These Mac OS X clients are doing video editing.
> 
> Currently the video are captured directly to the NFS mounts.
> 
> Here is the problem. The video files are broken into 2GB files. This
> because the video editing software(Final Cut Pro) breaks the files into
> 2GB sizes. It does not seem that the Mac OS X is not doing the breaking
> up of files. It is the video editing software.
> 
> Some commercial company found an interesting behaviour. All the Mac OS X
> NFS server FSINFO response in which the max file size is set to 'FFFF
> FFFF FFFF FFFF' (all '1's).
> 
> The link about the above information can be found at this link below.
> Read towards the bottom of the link.
> http://forums.creativecow.net/thread/8/975362
> 
> I really would like to know where to change in the NFS source code so
> that the FSINFO response from the server in which the max file size is
> set to 'FFFF FFFF FFFF FFFF' (all '1's).

I think you're probably barking up the wrong tree, but the max file size
as returned by fsinfo is set in fs/nfsd/nfs3proc.c:nfsd3_proc_fsinfo().

--b.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change the FSINFO for nfsd?
  2008-05-09  4:22 ` J. Bruce Fields
@ 2008-05-11 16:44   ` P.V.Anthony
  2008-05-11 17:36     ` Bernd Eckenfels
  2008-05-17 17:57   ` Solved - " P.V.Anthony
  1 sibling, 1 reply; 11+ messages in thread
From: P.V.Anthony @ 2008-05-11 16:44 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-kernel

J. Bruce Fields wrote:

> I think you're probably barking up the wrong tree, but the max file size
> as returned by fsinfo is set in fs/nfsd/nfs3proc.c:nfsd3_proc_fsinfo().

Thank you very much for information on which file to change.

Need to ask one question. Please bear with me as I am not a programmer.

1. What program should be used to see the FSINFO of a NFS server?
This program is needed to see if the changes done to the source is
returning with the required FSINFO information.

Just for the record, the change done is as follows.

/usr/src/linux/fs/nfsd # diff nfs3proc.c.org nfs3proc.c
558c558
<       resp->f_maxfilesize = ~(u32) 0;
---
>       resp->f_maxfilesize = 1111111111111111;

P.V.Anthony


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change the FSINFO for nfsd?
  2008-05-11 16:44   ` P.V.Anthony
@ 2008-05-11 17:36     ` Bernd Eckenfels
  0 siblings, 0 replies; 11+ messages in thread
From: Bernd Eckenfels @ 2008-05-11 17:36 UTC (permalink / raw)
  To: linux-kernel

In article <4827227D.6040903@singnet.com.sg> you wrote:
> 1. What program should be used to see the FSINFO of a NFS server?

I think pathconf is supposed to do that, however I dont remember if it can
query filesize. I have seen only PATH_MAX und NAME_MAX on NFS>=3.

However you can strace that:

# strace getconf NAME_MAX /nfs/home
...
readlink("/usr/lib/getconf/default", 0xbf846ea6, 21) = -1 ENOENT (No such file or directory)
statfs("/nfs/home/", {f_type="NFS_SUPER_MAGIC", f_bsize=16384, f_blocks=3731367, f_bfree=454412, f_bavail=155902, f_files=7725054, f_ffree=7434759, f_fsid={0, 0}, f_namelen=255, f_frsize=16384}) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f33000
write(1, "255\n") = 4
255

In my example the FreeBSD Server is not returning max filesize..

Gruss
Bernd

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Solved - How to change the FSINFO for nfsd?
  2008-05-09  4:22 ` J. Bruce Fields
  2008-05-11 16:44   ` P.V.Anthony
@ 2008-05-17 17:57   ` P.V.Anthony
  2008-05-17 18:25     ` Jan Engelhardt
  1 sibling, 1 reply; 11+ messages in thread
From: P.V.Anthony @ 2008-05-17 17:57 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-kernel

Quoting "J. Bruce Fields":
> I think you'reprobably barking up the wrong tree, but the max file size
> as returned by fsinfo is set in fs/nfsd/nfs3proc.c:nfsd3_proc_fsinfo().

Just in case someone needs to know this information. Please note that  
I am not a
programmer. I am just hacking away.

Most of the credit for the hack goes to the person in the forum  
mentioned below
for finding the Mac NFS behavior.
http://forums.creativecow.net/thread/8/975362

The changes done seem to work well.

I am dissapointed that Apple made changes to NFS to a point that we  
have to use an Apple NFS. I thought that NFS is open. Anyway with  
these changes, a Linux server can be used.

Anyway this problem only happens from with in the video editing application,
Final Cut Pro, an Apple product. I hope someday a good video editing  
application
comes to Linux. I am willing to pay for Linux video editing  
application. It must
be good that is.

Anyway here is the patch done.

------------------- start ------------------------------

pv at videoserver2 ~ $ diff -ruN
/usr/src/linux-2.6.22-gentoo-r8/fs/nfsd/nfs3proc.c.org
/usr/src/linux-2.6.22-gentoo-r8/fs/nfsd/nfs3proc.c
--- /usr/src/linux-2.6.22-gentoo-r8/fs/nfsd/nfs3proc.c.org 2008-05-09
13:07:19.000000000 +0800
+++ /usr/src/linux-2.6.22-gentoo-r8/fs/nfsd/nfs3proc.c 2008-05-13
23:54:56.000000000 +0800
@@ -555,7 +555,7 @@
resp->f_wtpref = max_blocksize;
resp->f_wtmult = PAGE_SIZE;
resp->f_dtpref = PAGE_SIZE;
- resp->f_maxfilesize = ~(u32) 0;
+ resp->f_maxfilesize = 0xffffffffffffffff;
resp->f_properties = NFS3_FSF_DEFAULT;

nfserr = fh_verify(rqstp, &argp->fh, 0, MAY_NOP);
@@ -570,7 +570,7 @@
if (sb->s_magic == 0x4d44 /* MSDOS_SUPER_MAGIC */) {
resp->f_properties = NFS3_FSF_BILLYBOY;
}
- resp->f_maxfilesize = sb->s_maxbytes;
+ resp->f_maxfilesize = 0xffffffffffffffff;
}

fh_put(&argp->fh);

---------------- end -------------------------------------------------

P.V.Anthony



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Solved - How to change the FSINFO for nfsd?
  2008-05-17 17:57   ` Solved - " P.V.Anthony
@ 2008-05-17 18:25     ` Jan Engelhardt
  2008-05-17 18:36       ` Trond Myklebust
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Engelhardt @ 2008-05-17 18:25 UTC (permalink / raw)
  To: P.V.Anthony; +Cc: J. Bruce Fields, linux-kernel


On Saturday 2008-05-17 19:57, P.V.Anthony wrote:
>
> pv at videoserver2 ~ $ diff -ruN
> /usr/src/linux-2.6.22-gentoo-r8/fs/nfsd/nfs3proc.c.org
> /usr/src/linux-2.6.22-gentoo-r8/fs/nfsd/nfs3proc.c
> --- /usr/src/linux-2.6.22-gentoo-r8/fs/nfsd/nfs3proc.c.org 2008-05-09
> 13:07:19.000000000 +0800
> +++ /usr/src/linux-2.6.22-gentoo-r8/fs/nfsd/nfs3proc.c 2008-05-13
> 23:54:56.000000000 +0800
> @@ -555,7 +555,7 @@
> resp->f_wtpref = max_blocksize;
> resp->f_wtmult = PAGE_SIZE;
> resp->f_dtpref = PAGE_SIZE;
> - resp->f_maxfilesize = ~(u32) 0;
> + resp->f_maxfilesize = 0xffffffffffffffff;

Hm, you could have just changed u32 to u64 :-)

> resp->f_properties = NFS3_FSF_DEFAULT;
>
> nfserr = fh_verify(rqstp, &argp->fh, 0, MAY_NOP);
> @@ -570,7 +570,7 @@
> if (sb->s_magic == 0x4d44 /* MSDOS_SUPER_MAGIC */) {
> resp->f_properties = NFS3_FSF_BILLYBOY;
> }
> - resp->f_maxfilesize = sb->s_maxbytes;
> + resp->f_maxfilesize = 0xffffffffffffffff;
> }
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Solved - How to change the FSINFO for nfsd?
  2008-05-17 18:25     ` Jan Engelhardt
@ 2008-05-17 18:36       ` Trond Myklebust
  2008-05-19 17:24         ` J. Bruce Fields
  0 siblings, 1 reply; 11+ messages in thread
From: Trond Myklebust @ 2008-05-17 18:36 UTC (permalink / raw)
  To: P.V.Anthony; +Cc: J. Bruce Fields, linux-kernel

On Sat, 2008-05-17 at 20:25 +0200, Jan Engelhardt wrote:
> On Saturday 2008-05-17 19:57, P.V.Anthony wrote:
> > resp->f_properties = NFS3_FSF_DEFAULT;
> >
> > nfserr = fh_verify(rqstp, &argp->fh, 0, MAY_NOP);
> > @@ -570,7 +570,7 @@
> > if (sb->s_magic == 0x4d44 /* MSDOS_SUPER_MAGIC */) {
> > resp->f_properties = NFS3_FSF_BILLYBOY;
> > }
> > - resp->f_maxfilesize = sb->s_maxbytes;
> > + resp->f_maxfilesize = 0xffffffffffffffff;

   This is plain wrong! Pretending that your filesystem supports 64-bit
files won't magically make it so.

Trond


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Solved - How to change the FSINFO for nfsd?
  2008-05-17 18:36       ` Trond Myklebust
@ 2008-05-19 17:24         ` J. Bruce Fields
  2008-05-19 17:59           ` P.V.Anthony
  2008-05-20  8:15           ` P.V.Anthony
  0 siblings, 2 replies; 11+ messages in thread
From: J. Bruce Fields @ 2008-05-19 17:24 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: P.V.Anthony, linux-kernel

On Sat, May 17, 2008 at 02:36:42PM -0400, Trond Myklebust wrote:
> On Sat, 2008-05-17 at 20:25 +0200, Jan Engelhardt wrote:
> > On Saturday 2008-05-17 19:57, P.V.Anthony wrote:
> > > resp->f_properties = NFS3_FSF_DEFAULT;
> > >
> > > nfserr = fh_verify(rqstp, &argp->fh, 0, MAY_NOP);
> > > @@ -570,7 +570,7 @@
> > > if (sb->s_magic == 0x4d44 /* MSDOS_SUPER_MAGIC */) {
> > > resp->f_properties = NFS3_FSF_BILLYBOY;
> > > }
> > > - resp->f_maxfilesize = sb->s_maxbytes;
> > > + resp->f_maxfilesize = 0xffffffffffffffff;
> 
>    This is plain wrong! Pretending that your filesystem supports 64-bit
> files won't magically make it so.

Yes.  Could you tell us what filesystem you're using?

It's a bit bizarre that this would fix anything; I'd think the more
likely result would be errors on write and/or some kind of file
corruption.

--b.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Solved - How to change the FSINFO for nfsd?
  2008-05-19 17:24         ` J. Bruce Fields
@ 2008-05-19 17:59           ` P.V.Anthony
  2008-05-20  8:15           ` P.V.Anthony
  1 sibling, 0 replies; 11+ messages in thread
From: P.V.Anthony @ 2008-05-19 17:59 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Trond Myklebust, linux-kernel

J. Bruce Fields wrote:
> On Sat, May 17, 2008 at 02:36:42PM -0400, Trond Myklebust wrote:
>> On Sat, 2008-05-17 at 20:25 +0200, Jan Engelhardt wrote:
>>> On Saturday 2008-05-17 19:57, P.V.Anthony wrote:
>>>> resp->f_properties = NFS3_FSF_DEFAULT;
>>>>
>>>> nfserr = fh_verify(rqstp, &argp->fh, 0, MAY_NOP);
>>>> @@ -570,7 +570,7 @@
>>>> if (sb->s_magic == 0x4d44 /* MSDOS_SUPER_MAGIC */) {
>>>> resp->f_properties = NFS3_FSF_BILLYBOY;
>>>> }
>>>> - resp->f_maxfilesize = sb->s_maxbytes;
>>>> + resp->f_maxfilesize = 0xffffffffffffffff;
>>    This is plain wrong! Pretending that your filesystem supports 64-bit
>> files won't magically make it so.
> 
> Yes.  Could you tell us what filesystem you're using?
> 
> It's a bit bizarre that this would fix anything; I'd think the more
> likely result would be errors on write and/or some kind of file
> corruption.

The filesystem used is ext3. So far no file corruption. The os is 64bit
gentoo.

Will be trying xfs without the patch and will report back. I think XFS
is 64bit and will see if Mac OS X with Final Cut Pro works with it.

Please not that the problem only happens when using the video editing
application Final Cut Pro. Without the patch, when capturing video to
the mounted NFS, the captured video is broken into 2Gb size files. This
is even when the server and client is set to version 3.

The old version of FCP does not have this behaviour.

I am guessing that Apple is some way forcing people to buy their Xserve
servers. To use their servers for NFS.

If a file is dragged on to the NFS mount then it will work fine. It only
does not work through the FCP application. Like when capturing or
exporting to a NFS mount.

P.V.Anthony



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Solved - How to change the FSINFO for nfsd?
  2008-05-19 17:24         ` J. Bruce Fields
  2008-05-19 17:59           ` P.V.Anthony
@ 2008-05-20  8:15           ` P.V.Anthony
  2008-05-20 13:12             ` Trond Myklebust
  1 sibling, 1 reply; 11+ messages in thread
From: P.V.Anthony @ 2008-05-20  8:15 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Trond Myklebust, linux-kernel

Using xfs filesystem on a gentoo 64bit linux with 2.6.22 kernel,
when mounting the FSINFO return got was 7f ff ff ff ff ff ff ff.

Assuming that xfs is 64bit,
the FSINFO returned is still not ff ff ff ff ff ff ff ff.

Used wireshark to see the FSINFO return.

P.V.Anthony

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Solved - How to change the FSINFO for nfsd?
  2008-05-20  8:15           ` P.V.Anthony
@ 2008-05-20 13:12             ` Trond Myklebust
  0 siblings, 0 replies; 11+ messages in thread
From: Trond Myklebust @ 2008-05-20 13:12 UTC (permalink / raw)
  To: P.V.Anthony; +Cc: J. Bruce Fields, linux-kernel

On Tue, 2008-05-20 at 16:15 +0800, P.V.Anthony wrote:
> Using xfs filesystem on a gentoo 64bit linux with 2.6.22 kernel,
> when mounting the FSINFO return got was 7f ff ff ff ff ff ff ff.
> 
> Assuming that xfs is 64bit,
> the FSINFO returned is still not ff ff ff ff ff ff ff ff.
> 
> Used wireshark to see the FSINFO return.
> 
> P.V.Anthony

XFS is 64-bit, but file sizes are of type off_t or loff_t, and are
therefore _signed_.
0x7fffffffffffffff is therefore indeed the maximum allowed file size for
a 64-bit filesystem.

Trond


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-05-20 13:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08 17:05 How to change the FSINFO for nfsd? P.V.Anthony
2008-05-09  4:22 ` J. Bruce Fields
2008-05-11 16:44   ` P.V.Anthony
2008-05-11 17:36     ` Bernd Eckenfels
2008-05-17 17:57   ` Solved - " P.V.Anthony
2008-05-17 18:25     ` Jan Engelhardt
2008-05-17 18:36       ` Trond Myklebust
2008-05-19 17:24         ` J. Bruce Fields
2008-05-19 17:59           ` P.V.Anthony
2008-05-20  8:15           ` P.V.Anthony
2008-05-20 13:12             ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox