09 Dec, 2011

1 commit


04 Nov, 2011

2 commits


30 Oct, 2011

1 commit


29 Oct, 2011

1 commit


25 Oct, 2011

4 commits


20 Oct, 2011

2 commits

  • Currently we cap the rsize at a value that fits in CIFSMaxBufSize. That's
    not needed any longer for readpages. Allow the use of larger values for
    readpages. cifs_iovec_read and cifs_read however are still limited to the
    CIFSMaxBufSize. Make sure they don't exceed that.

    The patch also changes the rsize defaults. The default when unix
    extensions are enabled is set to 1M for parity with the wsize, and there
    is a hard cap of ~16M.

    When unix extensions are not enabled, the default is set to 60k. According
    to MS-CIFS, Windows servers can only send a max of 60k at a time, so
    this is more efficient than requesting a larger size. If the user wishes
    however, the max can be extended up to 128k - the length of the READ_RSP
    header.

    Really old servers however require a special hack to ensure that we don't
    request too large a read.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Now that we have code in place to do asynchronous reads, convert
    cifs_readpages to use it. The new cifs_readpages walks the page_list
    that gets passed in, locks and adds the pages to the pagecache and
    sets up cifs_readdata to handle the reads.

    The rest is handled by the cifs_async_readv infrastructure.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     

18 Oct, 2011

1 commit

  • Smatch complains that the cast to "int" in min_t() changes very large
    values of current_read_size into negative values and so min_t()
    could return the wrong value. I removed the const as well, as that
    doesn't do anything here.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Steve French

    Dan Carpenter
     

14 Oct, 2011

2 commits


13 Oct, 2011

3 commits

  • Add mount options backupuid and backugid.

    It allows an authenticated user to access files with the intent to back them
    up including their ACLs, who may not have access permission but has
    "Backup files and directories user right" on them (by virtue of being part
    of the built-in group Backup Operators.

    When mount options backupuid is specified, cifs client restricts the
    use of backup intents to the user whose effective user id is specified
    along with the mount option.

    When mount options backupgid is specified, cifs client restricts the
    use of backup intents to the users whose effective user id belongs to the
    group id specified along with the mount option.

    If an authenticated user is not part of the built-in group Backup Operators
    at the server, access to such files is denied, even if allowed by the client.

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

    Shirish Pargaonkar
     
  • 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
     
  • server->maxBuf is the maximum SMB size (including header) that the
    server can handle. CIFSMaxBufSize is the maximum amount of data (sans
    header) that the client can handle. Currently maxBuf is being capped at
    CIFSMaxBufSize + the max headers size, and the two values are used
    somewhat interchangeably in the code.

    This makes little sense as these two values are not related at all.
    Separate them and make sure the code uses the right values in the right
    places.

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

    Jeff Layton
     

01 Aug, 2011

1 commit

  • Currently, we take a sb->s_active reference and a cifsFileInfo reference
    when an oplock break workqueue job is queued. This is unnecessary and
    more complicated than it needs to be. Also as Al points out,
    deactivate_super has non-trivial locking implications so it's best to
    avoid that if we can.

    Instead, just cancel any pending oplock breaks for this filehandle
    synchronously in cifsFileInfo_put after taking it off the lists.
    That should ensure that this job doesn't outlive the structures it
    depends on.

    Reported-by: Al Viro
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

23 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
    vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
    isofs: Remove global fs lock
    jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
    fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
    mm/truncate.c: fix build for CONFIG_BLOCK not enabled
    fs:update the NOTE of the file_operations structure
    Remove dead code in dget_parent()
    AFS: Fix silly characters in a comment
    switch d_add_ci() to d_splice_alias() in "found negative" case as well
    simplify gfs2_lookup()
    jfs_lookup(): don't bother with . or ..
    get rid of useless dget_parent() in btrfs rename() and link()
    get rid of useless dget_parent() in fs/btrfs/ioctl.c
    fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
    drivers: fix up various ->llseek() implementations
    fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
    Ext4: handle SEEK_HOLE/SEEK_DATA generically
    Btrfs: implement our own ->llseek
    fs: add SEEK_HOLE and SEEK_DATA flags
    reiserfs: make reiserfs default to barrier=flush
    ...

    Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
    shrinker callout for the inode cache, that clashed with the xfs code to
    start the periodic workers later.

    Linus Torvalds
     

21 Jul, 2011

2 commits

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

    Pavel Shilovsky
     
  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     

27 May, 2011

3 commits

  • secMode to sec_mode
    and
    cifsTconInfo to cifs_tcon
    and
    cifsSesInfo to cifs_ses

    Signed-off-by: Steve French

    Steve French
     
  • Add rwpidforward mount option that switches on a mode when we forward
    pid of a process who opened a file to any read and write operation.

    This can prevent applications like WINE from failing on read or write
    operation on a previously locked file region from the same netfd from
    another process if we use mandatory brlock style.

    It is actual for WINE because during a run of WINE program two processes
    work on the same netfd - share the same file struct between several VFS
    fds:
    1) WINE-server does open and lock;
    2) WINE-application does read and write.

    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Pavel Shilovsky
     
  • We need it to make them work with mandatory locking style because
    we can fail in a situation like when kernel need to flush dirty pages
    and there is a lock held by a process who opened file.

    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Pavel Shilovsky
     

26 May, 2011

1 commit

  • Have cifs_writepages issue asynchronous writes instead of waiting on
    each write call to complete before issuing another. This also allows us
    to return more quickly from writepages. It can just send out all of the
    I/Os and not wait around for the replies.

    In the WB_SYNC_ALL case, if the write completes with a retryable error,
    then the completion workqueue job will resend the write.

    This also changes the page locking semantics a little bit. Instead of
    holding the page lock until the response is received, release it after
    doing the send. This will reduce contention for the page lock and should
    prevent processes that have the file mmap'ed from being blocked
    unnecessarily.

    Signed-off-by: Jeff Layton
    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Jeff Layton
     

19 May, 2011

3 commits


12 Apr, 2011

3 commits

  • This is more or less the same patch as before, but with some merge
    conflicts fixed up.

    If a process has a dirty page mapped into its page tables, then it has
    the ability to change it while the client is trying to write the data
    out to the server. If that happens after the signature has been
    calculated then that signature will then be wrong, and the server will
    likely reset the TCP connection.

    This patch adds a page_mkwrite handler for CIFS that simply takes the
    page lock. Because the page lock is held over the life of writepage and
    writepages, this prevents the page from becoming writeable until
    the write call has completed.

    With this, we can also remove the "sign_zero_copy" module option and
    always inline the pages when writing.

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

    Jeff Layton
     
  • 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
     
  • cifs_close doesn't check that the filp->private_data is non-NULL before
    trying to put it. That can cause an oops in certain error conditions
    that can occur on open or lookup before the private_data is set.

    Reported-by: Ben Greear
    CC: Stable
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

10 Mar, 2011

1 commit

  • Code has been converted over to the new explicit on-stack plugging,
    and delay users have been converted to use the new API for that.
    So lets kill off the old plugging along with aops->sync_page().

    Signed-off-by: Jens Axboe

    Jens Axboe
     

04 Feb, 2011

1 commit


31 Jan, 2011

1 commit

  • New compiler warnings that I noticed when building a patchset based
    on recent Fedora kernel:

    fs/cifs/cifssmb.c: In function 'CIFSSMBSetFileSize':
    fs/cifs/cifssmb.c:4813:8: warning: variable 'data_offset' set but not used
    [-Wunused-but-set-variable]

    fs/cifs/file.c: In function 'cifs_open':
    fs/cifs/file.c:349:24: warning: variable 'pCifsInode' set but not used
    [-Wunused-but-set-variable]
    fs/cifs/file.c: In function 'cifs_partialpagewrite':
    fs/cifs/file.c:1149:23: warning: variable 'cifs_sb' set but not used
    [-Wunused-but-set-variable]
    fs/cifs/file.c: In function 'cifs_iovec_write':
    fs/cifs/file.c:1740:9: warning: passing argument 6 of 'CIFSSMBWrite2' from
    incompatible pointer type [enabled by default]
    fs/cifs/cifsproto.h:337:12: note: expected 'unsigned int *' but argument is
    of type 'size_t *'

    fs/cifs/readdir.c: In function 'cifs_readdir':
    fs/cifs/readdir.c:767:23: warning: variable 'cifs_sb' set but not used
    [-Wunused-but-set-variable]

    fs/cifs/cifs_dfs_ref.c: In function 'cifs_dfs_d_automount':
    fs/cifs/cifs_dfs_ref.c:342:2: warning: 'rc' may be used uninitialized in
    this function [-Wuninitialized]
    fs/cifs/cifs_dfs_ref.c:278:6: note: 'rc' was declared here

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

    Jeff Layton
     

26 Jan, 2011

1 commit

  • If we don't have Exclusive oplock we write a data to the server.
    Also set invalidate_mapping flag on the inode if we wrote something
    to the server. Add cifs_iovec_write to let the client write iovec
    buffers through CIFSSMBWrite2.

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

    Pavel Shilovsky
     

21 Jan, 2011

5 commits