Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Oct 2000 09:14:35 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        bp@butya.kz (Boris Popov)
Cc:        tlambert@primenet.com (Terry Lambert), cdillon@wolves.k12.mo.us (Chris Dillon), malachai@iname.com (Shawn Halpenny), freebsd-hackers@FreeBSD.ORG, freebsd-fs@FreeBSD.ORG
Subject:   Re: smbfs-1.3.0 released
Message-ID:  <200010310914.CAA28652@usr02.primenet.com>
In-Reply-To: <Pine.BSF.4.10.10010280855530.59778-100000@lion.butya.kz> from "Boris Popov" at Oct 28, 2000 09:14:09 AM

next in thread | previous in thread | raw e-mail | index | archive | help
> > The difference is that if you are iterating and comparing in
> > user space, you will get a failure, but if you are doing an
> > explicit VOP_LOOKUP in kernel space, the case folding will work.
> 
> 	Hmm, why ?

UNIX globbing occurs in user space.  Windows globbing, like VMS
globbing, happens in the kernel.

This means that if something is case sensitive on storage
but case insensitive on lookup, an iteration using VOP_READDIR
can get names that VOP_LOOKUP will be able to find, but that
VOP_READDIR won't match, since the matching rules aren't applied
in kernel space.

This means that things like renames:

	touch foo fee
	mv foo Test
	mv fee test

will fail to do the right thing.

The only way you can really support case insensitivity on lookup
is to move the globbing into the kernel, so that an iteration
over the directory does the right thing.  Or you could modify
all your applications to treat such FSs differently.


> > I think that if you disable the attempted case folding in the
> > SMBFS VOP_LOOKUP code, your problem will go away.
> 
> 	Not exactly so - case sensitivity depends on server, for most
> servers ls /A and ls /a are the same, but NT have strange behavior for
> root directory and not all directories are case insensitive.

The problem is that thee's really no way to support insensitive
lookup correctly through the iterative interface, when doing
globbing.  It doesn't matter if your application is "ls" or it's
"StarOffice".  You would still need a contract between the case
insensitive on lookup FS, and the code doing the globbing (in
this case, in user space).

> > NB: Another approach would be to fold everything to lower case
> > in both VOP_LOOKUP and VOP_READDIR; this could be accomplished
> > using a mount option.  If you wanted to be more Windows-like,
> > you could make the first letter upper case, and subsequent
> > letters lower case.
> 
> 	I'm unsure if this correct, because long file names used on
> windows platform may have more than one upper case letter (Program Files
> for example).

This is for the legacy stuff, not things like "Program Files".
Windows 95's client will "fake up" case, if it's talking to
a monocase server, by capitalizing the first letter.


> 	No, this is not related. The same things will happen on all SMB
> requests if server dropped the connection and it seems to be fixed in the
> upcoming smbfs-1.3.1. On a side note I'm unsure why NT server drops the
> connection if client doesn't send any request in XX minutes (for
> example Samba uses NetBIOS keepalive packets).

You might want to ask Jeremy Allison about this, I'm pretty sure
he would know.  It's probably a "feature" based on the protocol
rev you are talking to the server.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010310914.CAA28652>