[linux-cifs-client] Re: POSIX Create/Mkdir and Create Action
Steve French
smfrench at austin.rr.com
Sat Mar 10 05:41:42 GMT 2007
Jeremy Allison wrote:
> On Fri, Mar 09, 2007 at 09:45:01PM -0600, Steve French wrote:
>
>
>> Don't we need one more thing in the POSIX Create/Mkdir/Open response?
>>
>
> posix_mkdir returns EEXIST (or the NT_STATUS equivalent -
> NT_STATUS_OBJECT_NAME_COLLISION) if the pathname already
> existed, just like the system call.
>
>
>> In particular the CreateAction "FILE_CREATE" (not sure if the server
>> ever returns FILE_SUPERSEDE).
>>
>> Are there CreateActions others that the client should care about?
>>
>> The client pays attention to whether the file was created or opened e.g.
>> when the user asks us to overwrite the inodes default uid/gid with our
>> default uid/gid (although not the default mount option - it is allowed)
>> we need to know if the file is new.
>>
>
> I didn't know you needed to know that on posix_open.
> If you need that info you need to change the spec,
> now, before anything goes into production.
>
> George, James - do you need this ?
>
> Jeremy.
>
>
My proposal would be to either:
1) Overload a flag in the same field with the oplock bits e.g.
#define CREATE_ACTION 0x0010
or
2) Use the reserved (2 byte) pad field and call it CreateAction just as
it is in NTCreateX response
(although we should probably make it 4 bytes to match NTCreateX response)
or
3) Use a return code to indicate it existed and was opened -
unfortunately EEXIST is probably not possible to return as it would mean
the file existed and therefore could not be opened
Thoughts? I prefer option #2
-------------- next part --------------
HTML attachment scrubbed and removed
More information about the linux-cifs-client
mailing list