07 Nov, 2009

1 commit

  • It's possible that a server will return a valid FileID when we query the
    FILE_INTERNAL_INFO for the root inode, but then zeroed out inode numbers
    when we do a FindFile with an infolevel of
    SMB_FIND_FILE_ID_FULL_DIR_INFO.

    In this situation turn off querying for server inode numbers, generate a
    warning for the user and just generate an inode number using iunique.
    Once we generate any inode number with iunique we can no longer use any
    server inode numbers or we risk collisions, so ensure that we don't do
    that in cifs_get_inode_info either.

    Cc: Stable
    Reported-by: Timothy Normand Miller
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

25 Sep, 2009

3 commits

  • Fix problems with commits:

    086f68bd97126618ecb2dcff5f766f3a21722df7
    3bc303c254335dbd7c7012cc1760b12f1d5514d3

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

    Jeff Layton
     
  • ...it does the same thing as cifs_fill_fileinfo, but doesn't handle the
    flist ordering correctly. Also rename cifs_fill_fileinfo to a more
    descriptive name and have it take an open flags arg instead of just a
    write_only flag. That makes the logic in the callers a little simpler.

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

    Jeff Layton
     
  • This is the fourth respin of the patch to convert oplock breaks to
    use the slow_work facility.

    A customer of ours was testing a backport of one of the earlier
    patchsets, and hit a "Busy inodes after umount..." problem. An oplock
    break job had raced with a umount, and the superblock got torn down and
    its memory reused. When the oplock break job tried to dereference the
    inode->i_sb, the kernel oopsed.

    This patchset has the oplock break job hold an inode and vfsmount
    reference until the oplock break completes. With this, there should be
    no need to take a tcon reference (the vfsmount implicitly holds one
    already).

    Currently, when an oplock break comes in there's a chance that the
    oplock break job won't occur if the allocation of the oplock_q_entry
    fails. There are also some rather nasty races in the allocation and
    handling these structs.

    Rather than allocating oplock queue entries when an oplock break comes
    in, add a few extra fields to the cifsFileInfo struct. Get rid of the
    dedicated cifs_oplock_thread as well and queue the oplock break job to
    the slow_work thread pool.

    This approach also has the advantage that the oplock break jobs can
    potentially run in parallel rather than be serialized like they are
    today.

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

    Jeff Layton
     

16 Sep, 2009

1 commit

  • cifs_posix_open takes a "poplock" argument that's intended to be used in
    the actual posix open call to set the "Flags" field. It ignores this
    value however and declares an "oplock" parameter on the stack that it
    passes uninitialized to the CIFSPOSIXOpen function. Not only does this
    mean that the oplock request flags are bogus, but the result that's
    expected to be in that variable is unchanged.

    Fix this, and also clean up the type of the oplock parameter used. Since
    it's expected to be __u32, we should use that everywhere and not
    implicitly cast it from a signed type.

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

    Jeff Layton
     

10 Jul, 2009

3 commits

  • cifs: convert cifs_get_inode_info and non-posix readdir to use cifs_iget

    Rather than allocating an inode and filling it out, have
    cifs_get_inode_info fill out a cifs_fattr and call cifs_iget. This means
    a pretty hefty reorganization of cifs_get_inode_info.

    For the readdir codepath, add a couple of new functions for filling out
    cifs_fattr's from different FindFile response infolevels.

    Finally, remove cifs_new_inode since there are no more callers.

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

    Jeff Layton
     
  • cifs: add and use CIFSSMBUnixSetFileInfo for setattr calls

    When there's an open filehandle, SET_FILE_INFO is apparently preferred
    over SET_PATH_INFO. Add a new variant that sets a FILE_UNIX_INFO_BASIC
    infolevel via SET_FILE_INFO and switch cifs_setattr_unix to use the
    new call when there's an open filehandle available.

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

    Jeff Layton
     
  • cifs: rename CIFSSMBUnixSetInfo to CIFSSMBUnixSetPathInfo

    ...in preparation of adding a SET_FILE_INFO variant.

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

    Jeff Layton
     

02 Jul, 2009

1 commit

  • cifs: add new cifs_iget function and convert unix codepath to use it

    In order to unify some codepaths, introduce a common cifs_fattr struct
    for storing inode attributes. The different codepaths (unix, legacy,
    normal, etc...) can fill out this struct with inode info. It can then be
    passed as an arg to a common set of routines to get and update inodes.

    Add a new cifs_iget function that uses iget5_locked to identify inodes.
    This will compare inodes based on the uniqueid value in a cifs_fattr
    struct.

    Rather than filling out an already-created inode, have
    cifs_get_inode_info_unix instead fill out cifs_fattr and hand that off
    to cifs_iget. cifs_iget can then properly look for hardlinked inodes.

    On the readdir side, add a new cifs_readdir_lookup function that spawns
    populated dentries. Redefine FILE_UNIX_INFO so that it's basically a
    FILE_UNIX_BASIC_INFO that has a few fields wrapped around it. This
    allows us to more easily use the same function for filling out the fattr
    as the non-readdir codepath.

    With this, we should then have proper hardlink detection and can
    eventually get rid of some nasty CIFS-specific hacks for handing them.

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

    Jeff Layton
     

13 Jun, 2009

1 commit


29 May, 2009

1 commit

  • Thus spake Christoph:

    "But this whole set_cifs_acl function is a real mess anyway and needs
    some splitting up."

    With this change too, it's possible to call acl_to_uid_mode() with a
    NULL inode pointer. That (or something close to it) will eventually be
    necessary when cifs_get_inode_info is reorganized.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Shirish Pargaonkar
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Christoph Hellwig
     

28 May, 2009

2 commits


30 Apr, 2009

2 commits


18 Mar, 2009

1 commit


12 Mar, 2009

2 commits

  • If the network connection crashes, and we have to reopen files, preferentially
    use the newer cifs posix open protocol operation if the server supports it.

    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

4 commits


29 Jan, 2009

1 commit

  • cifs: turn smb_send into a wrapper around smb_sendv

    Rename smb_send2 to smb_sendv to make it consistent with kernel naming
    conventions for functions that take a vector.

    There's no need to have 2 functions to handle sending SMB calls. Turn
    smb_send into a wrapper around smb_sendv. This also allows us to
    properly mark the socket as needing to be reconnected when there's a
    partial send from smb_send.

    Also, in practice we always use the address and noblocksnd flag
    that's attached to the TCP_Server_Info. There's no need to pass
    them in as separate args to smb_sendv.

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

    Jeff Layton
     

29 Dec, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (31 commits)
    [CIFS] Remove redundant test
    [CIFS] make sure that DFS pathnames are properly formed
    Remove an already-checked error condition in SendReceiveBlockingLock
    Streamline SendReceiveBlockingLock: Use "goto out:" in an error condition
    Streamline SendReceiveBlockingLock: Use "goto out:" in an error condition
    [CIFS] Streamline SendReceive[2] by using "goto out:" in an error condition
    Slightly streamline SendReceive[2]
    Check the return value of cifs_sign_smb[2]
    [CIFS] Cleanup: Move the check for too large R/W requests
    [CIFS] Slightly simplify wait_for_free_request(), remove an unnecessary "else" branch
    Simplify allocate_mid() slightly: Remove some unnecessary "else" branches
    [CIFS] In SendReceive, move consistency check out of the mutexed region
    cifs: store password in tcon
    cifs: have calc_lanman_hash take more granular args
    cifs: zero out session password before freeing it
    cifs: fix wait_for_response to time out sleeping processes correctly
    [CIFS] Can not mount with prefixpath if root directory of share is inaccessible
    [CIFS] various minor cleanups pointed out by checkpatch script
    [CIFS] fix typo
    [CIFS] remove sparse warning
    ...

    Fix trivial conflict in fs/cifs/cifs_fs_sb.h due to comment changes for
    the CIFS_MOUNT_xyz bit definitions between cifs updates and security
    updates.

    Linus Torvalds
     

26 Dec, 2008

1 commit

  • cifs: have calc_lanman_hash take more granular args

    We need to use this routine to encrypt passwords associated with the
    tcon too. Don't assume that the password will be attached to the
    smb_session.

    Also, make some of the values in the lower encryption functions
    const since they aren't changed.

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

    Jeff Layton
     

14 Nov, 2008

1 commit

  • Wrap access to task credentials so that they can be separated more easily from
    the task_struct during the introduction of COW creds.

    Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().

    Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
    sense to use RCU directly rather than a convenient wrapper; these will be
    addressed by later patches.

    Signed-off-by: David Howells
    Reviewed-by: James Morris
    Acked-by: Serge Hallyn
    Cc: Steve French
    Cc: linux-cifs-client@lists.samba.org
    Signed-off-by: James Morris

    David Howells
     

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
     

25 Sep, 2008

1 commit


24 Sep, 2008

1 commit

  • cifs: add function to set file disposition

    The proper way to set the delete on close bit on an already existing
    file is to use SET_FILE_INFO with an infolevel of
    SMB_FILE_DISPOSITION_INFO. Add a function to do that and have the
    silly-rename code use it.

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

    Jeff Layton
     

06 Aug, 2008

3 commits


15 May, 2008

2 commits


13 May, 2008

1 commit


09 May, 2008

1 commit


29 Apr, 2008

1 commit


25 Apr, 2008

1 commit


16 Apr, 2008

1 commit


15 Mar, 2008

1 commit

  • Shirish Pargaonkar noted:
    With cifsacl mount option, when a file is created on the Windows server,
    exclusive oplock is broken right away because the get cifs acl code
    again opens the file to obtain security descriptor.
    The client does not have the newly created file handle or inode in any
    of its lists yet so it does not respond to oplock break and server waits for
    its duration and then responds to the second open. This slows down file
    creation signficantly. The fix is to pass the file descriptor to the get
    cifsacl code wherever available so that get cifs acl code does not send
    second open (NT Create ANDX) and oplock is not broken.

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

    Steve French