13 Oct, 2011

2 commits

  • The plan is to deprecate this interface by kernel version 3.4.

    Changes since v1
    - add a '\n' to the printk.

    Reported-by: Alexander Swen
    Cc: Jeff Layton
    Signed-off-by: Suresh Jayaraman
    Signed-off-by: Steve French

    Suresh Jayaraman
     
  • Thus spake Jeff Layton:

    "Making that a module parm would allow you to set that parameter at boot
    time without needing to add special startup scripts. IMO, all of the
    procfile "switches" under /proc/fs/cifs should be module parms
    instead."

    This patch doesn't alter the default behavior (Oplocks are enabled by
    default).

    To disable oplocks when loading the module, use

    modprobe cifs enable_oplocks=0

    (any of '0' or 'n' or 'N' conventions can be used).

    To disable oplocks at runtime using the new interface, use

    echo 0 > /sys/module/cifs/parameters/enable_oplocks

    The older /proc/fs/cifs/OplockEnabled interface will be deprecated
    after two releases. A subsequent patch will add an warning message
    about this deprecation.

    Changes since v2:
    - make enable_oplocks a 'bool'

    Changes since v1:
    - eliminate the use of extra variable by renaming the old one to
    enable_oplocks and make it an 'int' type.

    Reported-by: Alexander Swen
    Reviewed-by: Jeff Layton
    Signed-off-by: Suresh Jayaraman
    Signed-off-by: Steve French

    Steve French
     

12 Aug, 2011

1 commit

  • Christoph had requested that the stats related code (in
    CONFIG_CIFS_STATS2) be moved into helpers to make code flow more
    readable. This patch should help. For example the following
    section from transport.c

    spin_unlock(&GlobalMid_Lock);
    atomic_inc(&ses->server->num_waiters);
    wait_event(ses->server->request_q,
    atomic_read(&ses->server->inFlight)
    < cifs_max_pending);
    atomic_dec(&ses->server->num_waiters);
    spin_lock(&GlobalMid_Lock);

    becomes simpler (with the patch below):
    spin_unlock(&GlobalMid_Lock);
    cifs_num_waiters_inc(server);
    wait_event(server->request_q,
    atomic_read(&server->inFlight)
    < cifs_max_pending);
    cifs_num_waiters_dec(server);
    spin_lock(&GlobalMid_Lock);

    Reviewed-by: Jeff Layton
    CC: Christoph Hellwig
    Signed-off-by: Steve French
    Reviewed-by: Pavel Shilovsky

    Steve French
     

27 May, 2011

1 commit


19 May, 2011

1 commit

  • This is the same patch as originally posted, just with some merge
    conflicts fixed up...

    Currently, the ByteCount is usually converted to host-endian on receive.
    This is confusing however, as we need to keep two sets of routines for
    accessing it, and keep track of when to use each routine. Munging
    received packets like this also limits when the signature can be
    calulated.

    Simplify the code by keeping the received ByteCount in little-endian
    format. This allows us to eliminate a set of routines for accessing it
    and we can now drop the *_le suffixes from the accessor functions since
    that's now implied.

    While we're at it, switch all of the places that read the ByteCount
    directly to use the get_bcc inline which should also clean up some
    unaligned accesses.

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

    Jeff Layton
     

12 Apr, 2011

1 commit

  • This flag currently only affects whether we allow "zero-copy" writes
    with signing enabled. Typically we map pages in the pagecache directly
    into the write request. If signing is enabled however and the contents
    of the page change after the signature is calculated but before the
    write is sent then the signature will be wrong. Servers typically
    respond to this by closing down the socket.

    Still, this can provide a performance benefit so the "Experimental" flag
    was overloaded to allow this. That's really not a good place for this
    option however since it's not clear what that flag does.

    Move that flag instead to a new module parameter that better describes
    its purpose. That's also better since it can be set at module insertion
    time by configuring modprobe.d.

    Reviewed-by: Suresh Jayaraman
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

21 Jan, 2011

1 commit

  • In order to incorporate async requests, we need to allow for a more
    general way to do things on receive, rather than just waking up a
    process.

    Turn the task pointer in the mid_q_entry into a callback function and a
    generic data pointer. When a response comes in, or the socket is
    reconnected, cifsd can call the callback function in order to wake up
    the process.

    The default is to just wake up the current process which should mean no
    change in behavior for existing code.

    Also, clean up the locking in cifs_reconnect. There doesn't seem to be
    any need to hold both the srv_mutex and GlobalMid_Lock when walking the
    list of mids.

    Reviewed-by: Suresh Jayaraman
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

20 Jan, 2011

1 commit

  • It's an atomic_t and the code accesses the "counter" field in it directly
    instead of using atomic_read(). It also is sometimes accessed under a
    spinlock and sometimes not. Move it out of the spinlock since we don't need
    belt-and-suspenders for something that's just informational.

    Reviewed-by: Suresh Jayaraman
    Reviewed-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

10 Jan, 2011

1 commit


21 Oct, 2010

1 commit

  • cifs_tcp_ses_lock is a rwlock with protects the cifs_tcp_ses_list,
    server->smb_ses_list and the ses->tcon_list. It also protects a few
    ref counters in server, ses and tcon. In most cases the critical section
    doesn't seem to be large, in a few cases where it is slightly large, there
    seem to be really no benefit from concurrent access. I briefly considered RCU
    mechanism but it appears to me that there is no real need.

    Replace it with a spinlock and get rid of the last rwlock in the cifs code.

    Signed-off-by: Suresh Jayaraman
    Signed-off-by: Steve French

    Suresh Jayaraman
     

06 Aug, 2010

1 commit

  • Fixed the nit pointed out by Jeff.

    From: Suresh Jayaraman
    Subject: [PATCH 1/2] cifs: show features compiled in as part of DebugData

    This patch adds the features that are compiled in to the CIFS debugging data
    as shown below:

    $cat /proc/fs/cifs/DebugData
    Display Internal CIFS Data Structures for Debugging
    ---------------------------------------------------
    CIFS Version 1.64
    Features: dfs fscache posix spnego xattr
    Active VFS Requests: 0
    ...

    This patch provides a definitive way to tell what features are currently
    enabled in the running kernel. This could also help debugging.

    Signed-off-by: Suresh Jayaraman
    Cc: Jeff Layton
    Signed-off-by: Steve French

    Suresh Jayaraman
     

27 Apr, 2010

1 commit


21 Apr, 2010

1 commit

  • Neaten cERROR and cFYI macros, reduce text space
    ~2.5K

    Convert '__FILE__ ": " fmt' to '"%s: " fmt', __FILE__' to save text space
    Surround macros with do {} while
    Add parentheses to macros
    Make statement expression macro from macro with assign
    Remove now unnecessary parentheses from cFYI and cERROR uses

    defconfig with CIFS support old
    $ size fs/cifs/built-in.o
    text data bss dec hex filename
    156012 1760 148 157920 268e0 fs/cifs/built-in.o

    defconfig with CIFS support old
    $ size fs/cifs/built-in.o
    text data bss dec hex filename
    153508 1760 148 155416 25f18 fs/cifs/built-in.o

    allyesconfig old:
    $ size fs/cifs/built-in.o
    text data bss dec hex filename
    309138 3864 74824 387826 5eaf2 fs/cifs/built-in.o

    allyesconfig new
    $ size fs/cifs/built-in.o
    text data bss dec hex filename
    305655 3864 74824 384343 5dd57 fs/cifs/built-in.o

    Signed-off-by: Joe Perches
    Signed-off-by: Steve French

    Joe Perches
     

10 Jul, 2009

1 commit


31 Mar, 2009

1 commit

  • Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
    as correctly noted at bug #12454. Someone can lookup entry with NULL
    ->owner, thus not pinning enything, and release it later resulting
    in module refcount underflow.

    We can keep ->owner and supply it at registration time like ->proc_fops
    and ->data.

    But this leaves ->owner as easy-manipulative field (just one C assignment)
    and somebody will forget to unpin previous/pin current module when
    switching ->owner. ->proc_fops is declared as "const" which should give
    some thoughts.

    ->read_proc/->write_proc were just fixed to not require ->owner for
    protection.

    rmmod'ed directories will be empty and return "." and ".." -- no harm.
    And directories with tricky enough readdir and lookup shouldn't be modular.
    We definitely don't want such modular code.

    Removing ->owner will also make PDE smaller.

    So, let's nuke it.

    Kudos to Jeff Layton for reminding about this, let's say, oversight.

    http://bugzilla.kernel.org/show_bug.cgi?id=12454

    Signed-off-by: Alexey Dobriyan

    Alexey Dobriyan
     

12 Mar, 2009

1 commit

  • 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
     

17 Nov, 2008

2 commits


15 Nov, 2008

2 commits

  • We do this by abandoning the global list of SMB sessions and instead
    moving to a per-server list. This entails adding a new list head to the
    TCP_Server_Info struct. The refcounting for the cifsSesInfo is moved to
    a non-atomic variable. We have to protect it by a lock anyway, so there's
    no benefit to making it an atomic. The list and refcount are protected
    by the global cifs_tcp_ses_lock.

    The patch also adds a new routines to find and put SMB sessions and
    that properly take and put references under the lock.

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

    Jeff Layton
     
  • The code that allows these structs to be shared is extremely racy.
    Disable the sharing of SMB and tcon structs for now until we can
    come up with a way to do this that's race free.

    We want to continue to share TCP sessions, however since they are
    required for multiuser mounts. For that, implement a new (hopefully
    race-free) scheme. Add a new global list of TCP sessions, and take
    care to get a reference to it whenever we're dealing with one.

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

    Jeff Layton
     

14 Nov, 2008

1 commit


09 Aug, 2008

1 commit


24 Jul, 2008

3 commits


29 Apr, 2008

1 commit


18 Feb, 2008

1 commit


13 Feb, 2008

1 commit


08 Feb, 2008

1 commit


05 Oct, 2007

1 commit

  • Fixes two problems:
    1) we dropped down to negotiating lanman if we did not recognize the
    mechanism (krb5 e.g.)
    2) we did not stop cifsd (thus will fail when doing rmod cifs with
    slab free errors) when we fail tcon but have a bad session (which is
    the case in which signing is required but we don't allow signing on
    the client)

    It also turns on extended security flag in the header when passing
    "sec=krb5" on mount command (although kerberos support is not done of
    course)

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

    Steve French
     

15 Sep, 2007

2 commits


13 Jul, 2007

1 commit

  • This should be the last big batch of whitespace/formatting fixes.
    checkpatch warnings for the cifs directory are down about 90% and
    many of the remaining ones are harder to remove or make the code
    harder to read.

    Signed-off-by: Steve French

    Steve French
     

29 Jun, 2007

1 commit


25 Jun, 2007

1 commit


06 Jun, 2007

1 commit


22 Jan, 2007

1 commit


06 Jun, 2006

1 commit


05 Jun, 2006

1 commit


03 Jun, 2006

1 commit