public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bug in nfs in 2.6.18-rc5?
@ 2006-08-31 14:54 Shaya Potter
  2006-08-31 15:20 ` Shaya Potter
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Shaya Potter @ 2006-08-31 14:54 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel, unionfs

so I'm trying to use unionfs, cachefs and nfs, as cachefs is 2.6.18-rc5 
right now, thats what I'm testing, but I hit an oops.

basically unionfs's lookup does a "lookup_one_len()" on the underlying fs.

lookup_one_len() calls __lookup_hash()

__lookup_hash() is called as "__lookup_hash(&this, base, NULL)"

now that NULL is important.  that's the nameidata entry of __lookup_hash()

__lookup_hash() ends up calling the underlying fs's lookup op, i.e. 
nfs_lookup()

nfs_lookup() calls nfs_reval_fsid(nd->mnt, dir, &fhandle, &fattr);

see the bug? :)

This doesn't seem like a unionfs bug, as one should be able to call 
lookup_one_len() on an NFS fs.

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

* Re: bug in nfs in 2.6.18-rc5?
  2006-08-31 14:54 bug in nfs in 2.6.18-rc5? Shaya Potter
@ 2006-08-31 15:20 ` Shaya Potter
  2006-08-31 16:03 ` Trond Myklebust
  2006-08-31 16:27 ` Christoph Hellwig
  2 siblings, 0 replies; 8+ messages in thread
From: Shaya Potter @ 2006-08-31 15:20 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel, unionfs

Shaya Potter wrote:
> so I'm trying to use unionfs, cachefs and nfs, as cachefs is 2.6.18-rc5 
> right now, thats what I'm testing, but I hit an oops.
> 
> basically unionfs's lookup does a "lookup_one_len()" on the underlying fs.
> 
> lookup_one_len() calls __lookup_hash()
> 
> __lookup_hash() is called as "__lookup_hash(&this, base, NULL)"
> 
> now that NULL is important.  that's the nameidata entry of __lookup_hash()
> 
> __lookup_hash() ends up calling the underlying fs's lookup op, i.e. 
> nfs_lookup()
> 
> nfs_lookup() calls nfs_reval_fsid(nd->mnt, dir, &fhandle, &fattr);
> 
> see the bug? :)
> 
> This doesn't seem like a unionfs bug, as one should be able to call 
> lookup_one_len() on an NFS fs.

ok my "fix" is basically that nfs_reval_fsid() uses the nd->mnt to get 
to mnt->mnt_root.

I basically switched it to take a dentry and I call it as

nfs_reval_fsid(dentry->d_sb->s_root, dir.....)

have no clue if this is correct, but it doesn't oops anymore and seems 
to "work".

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

* Re: bug in nfs in 2.6.18-rc5?
  2006-08-31 14:54 bug in nfs in 2.6.18-rc5? Shaya Potter
  2006-08-31 15:20 ` Shaya Potter
@ 2006-08-31 16:03 ` Trond Myklebust
  2006-08-31 16:24   ` Shaya Potter
  2006-08-31 16:26   ` Christoph Hellwig
  2006-08-31 16:27 ` Christoph Hellwig
  2 siblings, 2 replies; 8+ messages in thread
From: Trond Myklebust @ 2006-08-31 16:03 UTC (permalink / raw)
  To: Shaya Potter; +Cc: linux-fsdevel, linux-kernel, unionfs

On Thu, 2006-08-31 at 10:54 -0400, Shaya Potter wrote:

> __lookup_hash() ends up calling the underlying fs's lookup op, i.e. 
> nfs_lookup()
> 
> nfs_lookup() calls nfs_reval_fsid(nd->mnt, dir, &fhandle, &fattr);
> 
> see the bug? :)
> 
> This doesn't seem like a unionfs bug, as one should be able to call 
> lookup_one_len() on an NFS fs.

Did someone start handing out these promises when I wasn't looking?

AFAICS, lookup_one_len() should only be used by the filesystem itself,
or by services like nfsd that have intimate knowledge of the
filesystem's inner workings.

The reason why NFS would like to insist on that nameidata is that we
need to be able to create mountpoints on the fly when we cross from one
filesystem on the server to another. Otherwise, we cannot offer the type
of guarantees that POSIX applications expect, such as the ability to
provide unique permanent inode numbers.
If we're to provide the ability for unionfs to use lookup_one_len() on
NFS, then we will have to error out whenever we hit a case where we
should be creating a new mountpoint. Is that acceptable?

Cheers,
  Trond


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

* Re: bug in nfs in 2.6.18-rc5?
  2006-08-31 16:03 ` Trond Myklebust
@ 2006-08-31 16:24   ` Shaya Potter
  2006-08-31 16:43     ` Trond Myklebust
  2006-08-31 16:26   ` Christoph Hellwig
  1 sibling, 1 reply; 8+ messages in thread
From: Shaya Potter @ 2006-08-31 16:24 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-fsdevel, linux-kernel, unionfs

Trond Myklebust wrote:
> On Thu, 2006-08-31 at 10:54 -0400, Shaya Potter wrote:
> 
>> __lookup_hash() ends up calling the underlying fs's lookup op, i.e. 
>> nfs_lookup()
>>
>> nfs_lookup() calls nfs_reval_fsid(nd->mnt, dir, &fhandle, &fattr);
>>
>> see the bug? :)
>>
>> This doesn't seem like a unionfs bug, as one should be able to call 
>> lookup_one_len() on an NFS fs.
> 
> Did someone start handing out these promises when I wasn't looking?
> 
> AFAICS, lookup_one_len() should only be used by the filesystem itself,
> or by services like nfsd that have intimate knowledge of the
> filesystem's inner workings.
> 
> The reason why NFS would like to insist on that nameidata is that we
> need to be able to create mountpoints on the fly when we cross from one
> filesystem on the server to another. Otherwise, we cannot offer the type
> of guarantees that POSIX applications expect, such as the ability to
> provide unique permanent inode numbers.
> If we're to provide the ability for unionfs to use lookup_one_len() on
> NFS, then we will have to error out whenever we hit a case where we
> should be creating a new mountpoint. Is that acceptable?

why does the client care about server mounted file systems?  The 
server's nfsd has to tell them apart, otherwise shouldn't give them to 
the client.  Otherwise it seems like the nfsd and the nfs client have to 
have innate knowledge of each other.

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

* Re: bug in nfs in 2.6.18-rc5?
  2006-08-31 16:03 ` Trond Myklebust
  2006-08-31 16:24   ` Shaya Potter
@ 2006-08-31 16:26   ` Christoph Hellwig
  2006-08-31 17:33     ` Trond Myklebust
  1 sibling, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2006-08-31 16:26 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Shaya Potter, linux-fsdevel, linux-kernel, unionfs

On Thu, Aug 31, 2006 at 12:03:50PM -0400, Trond Myklebust wrote:
> If we're to provide the ability for unionfs to use lookup_one_len() on
> NFS, then we will have to error out whenever we hit a case where we
> should be creating a new mountpoint. Is that acceptable?

Not at all.  unionfs will have to pass down proper lookup intents.
The ecryptfs developers have started looking into making that work
with stackable filesystems, and the unionfs developers should follow
that effort.

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

* Re: bug in nfs in 2.6.18-rc5?
  2006-08-31 14:54 bug in nfs in 2.6.18-rc5? Shaya Potter
  2006-08-31 15:20 ` Shaya Potter
  2006-08-31 16:03 ` Trond Myklebust
@ 2006-08-31 16:27 ` Christoph Hellwig
  2 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2006-08-31 16:27 UTC (permalink / raw)
  To: Shaya Potter; +Cc: linux-fsdevel, linux-kernel, unionfs

On Thu, Aug 31, 2006 at 10:54:07AM -0400, Shaya Potter wrote:
> so I'm trying to use unionfs, cachefs and nfs, as cachefs is 2.6.18-rc5 
> right now, thats what I'm testing, but I hit an oops.
> 
> basically unionfs's lookup does a "lookup_one_len()" on the underlying fs.

And there you have the bug already. unionfs must not do this, and given
the past discussion on this the unionfs developers should know that
very well :)


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

* Re: bug in nfs in 2.6.18-rc5?
  2006-08-31 16:24   ` Shaya Potter
@ 2006-08-31 16:43     ` Trond Myklebust
  0 siblings, 0 replies; 8+ messages in thread
From: Trond Myklebust @ 2006-08-31 16:43 UTC (permalink / raw)
  To: Shaya Potter; +Cc: linux-fsdevel, linux-kernel, unionfs

On Thu, 2006-08-31 at 12:24 -0400, Shaya Potter wrote:
> why does the client care about server mounted file systems?

It wants to allow POSIX applications to work correctly even in the case
where the nfsd administrator is using 'nohide'. It wants those same
applications to work correctly in the case where the nfsd administrator
is exporting more than one filesystem over NFSv4.

>   The 
> server's nfsd has to tell them apart, otherwise shouldn't give them to 
> the client.  Otherwise it seems like the nfsd and the nfs client have to 
> have innate knowledge of each other.

Of course the server knows that it is crossing a mountpoint. The client
figures it out by looking at the 'fsid' attribute (which uniquely labels
the filesystem on that server) in order to figure out which filesystem
that the file/directory it just looked up belongs to. Whenever the
fileid changes between parent directory and child, that means that a
mountpoint was crossed on the server.

  Trond


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

* Re: bug in nfs in 2.6.18-rc5?
  2006-08-31 16:26   ` Christoph Hellwig
@ 2006-08-31 17:33     ` Trond Myklebust
  0 siblings, 0 replies; 8+ messages in thread
From: Trond Myklebust @ 2006-08-31 17:33 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Shaya Potter, linux-fsdevel, linux-kernel, unionfs

On Thu, 2006-08-31 at 17:26 +0100, Christoph Hellwig wrote:
> On Thu, Aug 31, 2006 at 12:03:50PM -0400, Trond Myklebust wrote:
> > If we're to provide the ability for unionfs to use lookup_one_len() on
> > NFS, then we will have to error out whenever we hit a case where we
> > should be creating a new mountpoint. Is that acceptable?
> 
> Not at all.  unionfs will have to pass down proper lookup intents.
> The ecryptfs developers have started looking into making that work
> with stackable filesystems, and the unionfs developers should follow
> that effort.

Good. I fully agree that this is preferable.

Cheers,
  Trond


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

end of thread, other threads:[~2006-08-31 17:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-31 14:54 bug in nfs in 2.6.18-rc5? Shaya Potter
2006-08-31 15:20 ` Shaya Potter
2006-08-31 16:03 ` Trond Myklebust
2006-08-31 16:24   ` Shaya Potter
2006-08-31 16:43     ` Trond Myklebust
2006-08-31 16:26   ` Christoph Hellwig
2006-08-31 17:33     ` Trond Myklebust
2006-08-31 16:27 ` Christoph Hellwig

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