24 Feb, 2010

1 commit


01 Jan, 2010

1 commit


07 Dec, 2009

1 commit


25 Nov, 2009

1 commit


02 Sep, 2009

1 commit


04 Aug, 2009

1 commit


30 Jul, 2009

1 commit


10 Jul, 2009

1 commit


25 Jun, 2009

1 commit


07 Jun, 2009

1 commit


28 May, 2009

1 commit


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

1 commit


01 May, 2009

1 commit

  • 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
     

21 Apr, 2009

1 commit


17 Apr, 2009

1 commit

  • Jeff made a good point that we should endian convert the UniqueId when we use
    it to set i_ino Even though this value is opaque to the client, when comparing
    the inode numbers of the same server file from two different clients (one
    big endian, one little endian) or when we compare a big endian client's view
    of i_ino with what the server thinks - we should get the same value

    Signed-off-by: Steve French

    Steve French
     

18 Mar, 2009

1 commit


12 Mar, 2009

3 commits

  • Samba server (version 3.3.1 and earlier, and 3.2.8 and earlier) incorrectly
    required the O_CREAT flag on posix open (even when a file was not being
    created). This disables posix open (create is still ok) after the first
    attempt returns EINVAL (and logs an error, once, recommending that they
    update their server).

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

    Steve French
     
  • If this mount option is set, when an application does an
    fsync call then the cifs client does not send an SMB Flush
    to the server (to force the server to write all dirty data
    for this file immediately to disk), although cifs still sends
    all dirty (cached) file data to the server and waits for the
    server to respond to the write write. Since SMB Flush can be
    very slow, and some servers may be reliable enough (to risk
    delaying slightly flushing the data to disk on the server),
    turning on this option may be useful to improve performance for
    applications that fsync too much, at a small risk of server
    crash. If this mount option is not set, by default cifs will
    send an SMB flush request (and wait for a response) on every
    fsync call.

    Signed-off-by: Steve French

    Steve French
     
  • In contrast to the now-obsolete smbfs, cifs does not send SMB_COM_FLUSH
    in response to an explicit fsync(2) to guarantee that all volatile data
    is written to stable storage on the server side, provided the server
    honors the request (which, to my knowledge, is true for Windows and
    Samba with 'strict sync' enabled).
    This patch modifies the cifs_fsync implementation to restore the
    fsync-behavior of smbfs by triggering SMB_COM_FLUSH after sending
    outstanding data on the client side to the server.

    Signed-off-by: Horst Reiterer
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Steve French
     

21 Feb, 2009

3 commits

  • When two different users mount the same Windows 2003 Server share using CIFS,
    the first session mounted can be invalidated. Some servers invalidate the first
    smb session when a second similar user (e.g. two users who get mapped by server to "guest")
    authenticates an smb session from the same client.

    By making sure that we set the 2nd and subsequent vc numbers to nonzero values,
    this ensures that we will not have this problem.

    Fixes Samba bug 6004, problem description follows:
    How to reproduce:

    - configure an "open share" (full permissions to Guest user) on Windows 2003
    Server (I couldn't reproduce the problem with Samba server or Windows older
    than 2003)
    - mount the share twice with different users who will be authenticated as guest.

    noacl,noperm,user=john,dir_mode=0700,domain=DOMAIN,rw
    noacl,noperm,user=jeff,dir_mode=0700,domain=DOMAIN,rw

    Result:

    - just the mount point mounted last is accessible:

    Signed-off-by: Steve French

    Steve French
     
  • Samba server added support for a new posix open/create/mkdir operation
    a year or so ago, and we added support to cifs for mkdir to use it,
    but had not added the corresponding code to file create.

    The following patch helps improve the performance of the cifs create
    path (to Samba and servers which support the cifs posix protocol
    extensions). Using Connectathon basic test1, with 2000 files, the
    performance improved about 15%, and also helped reduce network traffic
    (17% fewer SMBs sent over the wire) due to saving a network round trip
    for the SetPathInfo on every file create.

    It should also help the semantics (and probably the performance) of
    write (e.g. when posix byte range locks are on the file) on file
    handles opened with posix create, and adds support for a few flags
    which would have to be ignored otherwise.

    Signed-off-by: Steve French

    Steve French
     
  • Fixes kernel bug #10451 http://bugzilla.kernel.org/show_bug.cgi?id=10451

    Certain NAS appliances do not set the operating system or network operating system
    fields in the session setup response on the wire. cifs was oopsing on the unexpected
    zero length response fields (when trying to null terminate a zero length field).

    This fixes the oops.

    Acked-by: Jeff Layton
    CC: stable
    Signed-off-by: Steve French

    Steve French
     

29 Jan, 2009

1 commit

  • When a search is pending of a parent directory, and a child directory
    within it is removed, we need to reset the parent directory's time
    so that we don't reuse the (now stale) search results.

    Thanks to Gunter Kukkukk for reporting this:

    > got the following failure notification on irc #samba:
    >
    > A user was updating from subversion 1.4 to 1.5, where the
    > repository is located on a samba share (independent of
    > unix extensions = Yes or No).
    > svn 1.4 did work, 1.5 does not.
    >
    > The user did a lot of stracing of subversion - and wrote a
    > testapplet to simulate the failing behaviour.
    > I've converted the C++ source to C and added some error cases.
    >
    > When using "./testdir" on a local file system, "result2"
    > is always (nil) as expected - cifs vfs behaves different here!
    >
    > ./testdir /mnt/cifs/mounted/share
    >
    > returns a (failing) valid pointer.

    Acked-by: Dave Kleikamp
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Steve French
     

26 Dec, 2008

3 commits

  • The paths in a DFS request are supposed to only have a single preceding
    backslash, but we are sending them with a double backslash. This is
    exposing a bug in Windows where it also sends a path in the response
    that has a double backslash.

    The existing code that builds the mount option string however expects a
    double backslash prefix in a couple of places when it tries to use the
    path returned by build_path_from_dentry. Fix compose_mount_options to
    expect properly formed DFS paths (single backslash at front).

    Also clean up error handling in that function. There was a possible
    NULL pointer dereference and situations where a partially built option
    string would be returned.

    Tested against Samba 3.0.28-ish server and Samba 3.3 and Win2k8.

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

    Steve French
     
  • Windows allows you to deny access to the top of a share, but permit access to
    a directory lower in the path. With the prefixpath feature of cifs
    (ie mounting \\server\share\directory\subdirectory\etc.) this should have
    worked if the user specified a prefixpath which put the root of the mount
    at a directory to which he had access, but we still were doing a lookup
    on the root of the share (null path) when we should have been doing it on
    the prefixpath subdirectory.

    This fixes Samba bug # 5925

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

    Steve French
     
  • Some applications/subsystems require mandatory byte range locks
    (as is used for Windows/DOS/OS2 etc). Sending advisory (posix style)
    byte range lock requests (instead of mandatory byte range locks) can
    lead to problems for these applications (which expect that other
    clients be prevented from writing to portions of the file which
    they have locked and are updating). This mount option allows
    mounting cifs with the new mount option "forcemand" (or
    "forcemandatorylock") in order to have the cifs client use mandatory
    byte range locks (ie SMB/CIFS/Windows/NTFS style locks) rather than
    posix byte range lock requests, even if the server would support
    posix byte range lock requests. This has no effect if the server
    does not support the CIFS Unix Extensions (since posix style locks
    require support for the CIFS Unix Extensions), but for mounts
    to Samba servers this can be helpful for Wine and applications
    that require mandatory byte range locks.

    Acked-by: Jeff Layton
    CC: Alexander Bokovoy
    Signed-off-by: Steve French

    Steve French
     

19 Nov, 2008

1 commit


29 Oct, 2008

1 commit

  • CIFS in some heavy stress conditions cifs could get EAGAIN
    repeatedly in smb_send2 which led to repeated retries and eventually
    failure of large writes which could lead to data corruption.

    There are three changes that were suggested by various network
    developers:

    1) convert cifs from non-blocking to blocking tcp sendmsg
    (we left in the retry on failure)
    2) change cifs to not set sendbuf and rcvbuf size for the socket
    (let tcp autotune the buffer sizes since that works much better
    in the TCP stack now)
    3) if we have a partial frame sent in smb_send2, mark the tcp
    session as invalid (close the socket and reconnect) so we do
    not corrupt the remaining part of the SMB with the beginning
    of the next SMB.

    This does not appear to hurt performance measurably and has
    been run in various scenarios, but it definately removes
    a corruption that we were seeing in some high stress
    test cases.

    Acked-by: Shirish Pargaonkar
    Signed-off-by: Steve French

    Steve French
     

23 Oct, 2008

1 commit

  • fcntl(F_SETLEASE) currently is not exported by cifs (nor by local file
    systems) so cifs grants leases based on how other local processes have
    opened the file not by whether the file is cacheable (oplocked). This
    adds the check to make sure that the file is cacheable on the client
    before checking whether we can grant the lease locally
    (generic_setlease). It also adds a mount option for cifs (locallease)
    if the user wants to override this and try to grant leases even
    if the server did not grant oplock.

    Signed-off-by: Steve French

    Steve French
     

20 Oct, 2008

1 commit


28 Aug, 2008

2 commits


26 Aug, 2008

1 commit


06 Aug, 2008

1 commit


11 Jun, 2008

1 commit


21 May, 2008

1 commit


13 May, 2008

1 commit

  • When CIFSFindNext gets back an -EBADF from a call, it sets the return
    code of the function to 0 and eventually exits. Doing this makes the
    cleanup at the end of the function skip freeing the SMB buffer, so
    we need to make sure we free the buffer explicitly when doing this.

    If we don't you end up with errors like this when unplugging the cifs
    kernel module:

    slab error in kmem_cache_destroy(): cache `cifs_request': Can't free all objects
    [] kmem_cache_destroy+0x61/0xf3
    [] cifs_destroy_request_bufs+0x14/0x28 [cifs]
    [] exit_cifs+0x1e/0x80 [cifs]
    [] sys_delete_module+0x192/0x1b8
    [] audit_syscall_entry+0x14b/0x17d
    [] syscall_call+0x7/0xb
    =======================

    Signed-off-by: Jeff Layton

    Jeff Layton
     

28 Apr, 2008

1 commit


05 Apr, 2008

1 commit