[linux-cifs-client] Re: SetFileDisposition before or after rename

Jeff Layton jlayton at redhat.com
Tue Sep 23 18:02:05 GMT 2008


On Tue, 23 Sep 2008 12:36:41 -0500
"Steve French" <smfrench at gmail.com> wrote:

> In http://git.samba.org/?p=jlayton/cifs.git;a=commitdiff;h=6bd5977a4df58b233512b52242d33c3540a3d8f9
> you do the SetFileDisposition after the rename - if the
> setfiledisposition failed do we even want to do the rename at all?
> 
> Is it worth changing this line:
> 
>         rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN,
> -                        DELETE|FILE_WRITE_ATTRIBUTES,
> -                        CREATE_NOT_DIR|CREATE_DELETE_ON_CLOSE,
> +                        DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR,
>                          &netfid, &oplock, NULL, cifs_sb->local_nls,
>                          cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
> 
> We still don't know if setting DELETE_ON_CLOSE on open works in some
> cases (and it can't hurt).
> 

JRA seemed pretty convinced that Windows servers always ignore that bit
in an open call. In fact, I think he mentioned that he had to fix samba
to do the same (maybe some windows clients set it unintentionally?).

As far as the ordering of the calls. I tried that first. Once you do a
SetFileDisposition, open-file renames no longer work. You have to set
the delete on close after renaming...

-- 
Jeff Layton <jlayton at redhat.com>


More information about the linux-cifs-client mailing list