24 May, 2009

1 commit

  • Small change (mostly formatting) to limit lookup based open calls to
    file create only.

    After discussion yesteday on samba-technical about the posix lookup
    regression, and looking at a problem with cifs posix open to one
    particular Samba version, Jeff and JRA realized that Samba server's
    behavior changed in this area (posix open behavior on files vs.
    directories). To make this behavior consistent, JRA just made a
    fix to Samba server to alter how it handles open of directories (now
    returning the equivalent of EISDIR instead of success). Since we don't
    know at lookup time whether the inode is a directory or file (and
    thus whether posix open will succeed with most current Samba server),
    this change avoids the posix open code on lookup open (just issues
    posix open on creates). This gets the semantic benefits we want
    (atomicity, posix byte range locks, improved write semantics on newly
    created files) and file create still is fast, and we avoid the problem
    that Jeff noticed yesterday with "openat" (and some open directory
    calls) of non-cached directories to one version of Samba server, and
    will work with future Samba versions (which include the fix jra just
    pushed into Samba server). I confirmed this approach with jra
    yesterday and with Shirish today.

    Posix open is only called (at lookup time) for file create now.
    For opens (rather than creates), because we do not know if it
    is a file or directory yet, and current Samba no longer allows
    us to do posix open on dirs, we could end up wasting an open call
    on what turns out to be a dir. For file opens, we wait to call posix
    open till cifs_open. It could be added here (lookup) in the future
    but the performance tradeoff of the extra network request when EISDIR
    or EACCES is returned would have to be weighed against the 50%
    reduction in network traffic in the other paths.

    Reviewed-by: Shirish Pargaonkar
    Tested-by: Jeff Layton
    CC: Jeremy Allison
    Signed-off-by: Steve French

    Steve French
     

22 May, 2009

1 commit

  • Posix open code was not properly adding the file to the
    list of open files. Fix allocating cifsFileInfo
    more than once, and adding twice to flist and tlist.
    Also fix mode setting to be done in one place in these
    paths.

    Signed-off-by: Steve French
    Reviewed-by: Shirish Pargaonkar
    Tested-by: Jeff Layton
    Tested-by: Luca Tettamanti

    Steve French
     

19 May, 2009

1 commit

  • This is the third respin of the patch posted yesterday to fix the error
    handling in cifs_follow_symlink. It also includes a fix for a bogus NULL
    pointer check in CIFSSMBQueryUnixSymLink that Jeff Moyer spotted.

    It's possible for CIFSSMBQueryUnixSymLink to return without setting
    target_path to a valid pointer. If that happens then the current value
    to which we're initializing this pointer could cause an oops when it's
    kfree'd.

    This patch is a little more comprehensive than the last patches. It
    reorganizes cifs_follow_link a bit for (hopefully) better readability.
    It should also eliminate the uneeded allocation of full_path on servers
    without unix extensions (assuming they can get to this point anyway, of
    which I'm not convinced).

    On a side note, I'm not sure I agree with the logic of enabling this
    query even when unix extensions are disabled on the client. It seems
    like that should disable this as well. But, changing that is outside the
    scope of this fix, so I've left it alone for now.

    Reported-by: Jeff Moyer
    Signed-off-by: Jeff Layton
    Reviewed-by: Jeff Moyer
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Steve French

    Jeff Layton
     

14 May, 2009

1 commit


09 May, 2009

2 commits


08 May, 2009

1 commit


06 May, 2009

2 commits


04 May, 2009

1 commit

  • The NTLMSSP code was removed from fs/cifs/connect.c and merged
    (75% smaller, cleaner) into fs/cifs/sess.c

    As with the old code it requires that cifs be built with
    CONFIG_CIFS_EXPERIMENTAL, the /proc/fs/cifs/Experimental flag
    must be set to 2, and mount must turn on extended security
    (e.g. with sec=krb5).

    Although NTLMSSP encapsulated in SPNEGO is not enabled yet,
    "raw" ntlmssp is common and useful in some cases since it
    offers more complete security negotiation, and is the
    default way of negotiating security for many Windows systems.
    SPNEGO encapsulated NTLMSSP will be able to reuse the same
    code.

    Signed-off-by: Steve French

    Steve French
     

02 May, 2009

7 commits


01 May, 2009

9 commits

  • Removes two sparse CHECK_ENDIAN warnings from Jeffs earlier patch,
    and removes the dead readlink code (after noting where in
    findfirst we will need to add something like that in the future
    to handle the newly discovered unexpected error on FindFirst of NTFS symlinks.

    Signed-off-by: Steve French

    Steve French
     
  • Signed-off-by: Steve French

    Steve French
     
  • Signed-off-by: Steve French

    Steve French
     
  • The earlier patch to move this code to use the new unicode helpers
    assumed that the filename strings would be null terminated. That's not
    always the case.

    Instead of passing "max_len" to the string converter, pass "min(len,
    max_len)", which makes it do the right thing while still keeping the
    parser confined to the response. Also fix up the prototypes of this
    function and the callers so that max_len is unsigned (like len is).

    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • Signed-off-by: Steve French

    Steve French
     
  • In most cases, cifs_strndup is converting from Unicode (UCS2 / UTF-32) to
    the configured local code page for the Linux mount (usually UTF8), so
    Jeff suggested that to make it more clear that cifs_strndup is doing
    a conversion not just memory allocation and copy, rename the function
    to including "from_ucs" (ie Unicode)

    Signed-off-by: Steve French

    Steve French
     
  • Added loop check when mounting DFS tree. mount will fail with
    ELOOP if referral walks exceed MAX_NESTED_LINK count.

    Signed-off-by: Igor Mammedov
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Igor Mammedov
     
  • Having remote dfs root support in cifs_mount, we can
    afford to pass into it UNC that is remote.

    Signed-off-by: Igor Mammedov
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Igor Mammedov
     
  • Two years ago, when the session setup code in cifs was rewritten and moved
    to fs/cifs/sess.c, we were asked to keep the old code for a release or so
    (which could be reenabled at runtime) since it was such a large change and
    because the asn (SPNEGO) and NTLMSSP code was not rewritten and needed to
    be. This was useful to avoid regressions, but is long overdue to be removed.
    Now that the Kerberos (asn/spnego) code is working in fs/cifs/sess.c,
    and the NTLMSSP code moved (NTLMSSP blob setup be rewritten with the
    next patch in this series) quite a bit of dead code from fs/cifs/connect.c
    now can be removed.

    This old code should have been removed last year, but the earlier krb5
    patches did not move/remove the NTLMSSP code which we had asked to
    be done first. Since no one else volunteered, I am doing it now.

    It is extremely important that we continue to examine the documentation
    for this area, to make sure our code continues to be uptodate with
    changes since Windows 2003.

    Signed-off-by: Steve French

    Steve French
     

30 Apr, 2009

8 commits


21 Apr, 2009

3 commits


18 Apr, 2009

1 commit


17 Apr, 2009

2 commits