16 Sep, 2016

1 commit


01 Aug, 2016

1 commit


30 Jul, 2016

2 commits


29 Jul, 2016

1 commit

  • This changes the vfs dentry hashing to mix in the parent pointer at the
    _beginning_ of the hash, rather than at the end.

    That actually improves both the hash and the code generation, because we
    can move more of the computation to the "static" part of the dcache
    setup, and do less at lookup runtime.

    It turns out that a lot of other hash users also really wanted to mix in
    a base pointer as a 'salt' for the hash, and so the slightly extended
    interface ends up working well for other cases too.

    Users that want a string hash that is purely about the string pass in a
    'salt' pointer of NULL.

    * merge branch 'salted-string-hash':
    fs/dcache.c: Save one 32-bit multiply in dcache lookup
    vfs: make the string hashes salt the hash

    Linus Torvalds
     

28 Jul, 2016

1 commit

  • if, when mounting //HOST/share/sub/dir/foo we can query /sub/dir/foo but
    not any of the path components above:

    - store the /sub/dir/foo prefix in the cifs super_block info
    - in the superblock, set root dentry to the subpath dentry (instead of
    the share root)
    - set a flag in the superblock to remember it
    - use prefixpath when building path from a dentry

    fixes bso#8950

    Signed-off-by: Aurelien Aptel
    CC: Stable
    Reviewed-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Aurelien Aptel
     

13 Jul, 2016

1 commit

  • When opening a file with O_CREAT flag, check to see if the file opened
    is an existing directory.

    This prevents the directory from being opened which subsequently causes
    a crash when the close function for directories cifs_closedir() is called
    which frees up the file->private_data memory while the file is still
    listed on the open file list for the tcon.

    Signed-off-by: Sachin Prabhu
    Signed-off-by: Steve French
    CC: Stable
    Reported-by: Xiaoli Feng

    Sachin Prabhu
     

06 Jul, 2016

1 commit


11 Jun, 2016

1 commit

  • We always mixed in the parent pointer into the dentry name hash, but we
    did it late at lookup time. It turns out that we can simplify that
    lookup-time action by salting the hash with the parent pointer early
    instead of late.

    A few other users of our string hashes also wanted to mix in their own
    pointers into the hash, and those are updated to use the same mechanism.

    Hash users that don't have any particular initial salt can just use the
    NULL pointer as a no-salt.

    Cc: Vegard Nossum
    Cc: George Spelvin
    Cc: Al Viro
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

11 May, 2015

1 commit

  • Cifs client has problem with reserved chars filename.

    [BUG1] : several functions handle incorrect value of mapchars
    - cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
    + cifs_remap(cifs_sb));

    [BUG2] : forget to convert reserved chars when creating SymbolicLink.
    - CIFSUnixCreateSymLink() calls cifs_strtoUTF16
    + CIFSUnixCreateSymLink() calls cifsConvertToUTF16() with remap

    [BUG3] : forget to convert reserved chars when getting SymbolicLink.
    - CIFSSMBUnixQuerySymLink() calls cifs_strtoUTF16
    + CIFSSMBUnixQuerySymLink() calls cifsConvertToUTF16() with remap

    [BUG4] : /proc/mounts don't show "mapposix" when using mapposix mount option
    + cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SFM_CHR)
    + seq_puts(s, ",mapposix");

    Reported-by: t.wede@kw-reneg.de
    Reported-by: Nakajima Akira
    Signed-off-by: Nakajima Akira
    Signed-off-by: Carl Schaefer
    Signed-off-by: Steve French

    Nakajima Akira
     

16 Apr, 2015

1 commit


17 Oct, 2014

1 commit

  • The "sfu" mount option did not work on SMB2/SMB3 mounts.
    With these changes when the "sfu" mount option is passed in
    on an smb2/smb2.1/smb3 mount the client can emulate (and
    recognize) fifo and device (character and device files).

    In addition the "sfu" mount option should not conflict
    with "mfsymlinks" (symlink emulation) as we will never
    create "sfu" style symlinks, but using "sfu" mount option
    will allow us to recognize existing symlinks, created with
    Microsoft "Services for Unix" (SFU and SUA).

    To enable the "sfu" mount option for SMB2/SMB3 the calling
    syntax of the generic cifs/smb2/smb3 sync_read and sync_write
    protocol dependent function needed to be changed (we
    don't have a file struct in all cases), but this actually
    ended up simplifying the code a little.

    Signed-off-by: Steve French

    Steve French
     

09 Oct, 2014

1 commit


22 Aug, 2014

1 commit

  • Currently cifs have all or nothing approach for directIO operations.
    cache=strict mode does not allow directIO while cache=none mode performs
    all the operations as directIO even when user does not specify O_DIRECT
    flag. This patch enables strict cache mode to honour directIO semantics.

    Signed-off-by: Namjae Jeon
    Signed-off-by: Ashish Sangwan
    Signed-off-by: Steve French

    Namjae Jeon
     

11 Feb, 2014

1 commit

  • When mounting with smb2/smb3 (e.g. vers=2.1) and cifsacl mount option,
    it was trying to get the mode by querying the acl over the cifs
    rather than smb2 protocol. This patch makes that protocol
    independent and makes cifsacl smb2 mounts return a more intuitive
    operation not supported error (until we add a worker function
    for smb2_get_acl).

    Note that a previous patch fixed getxattr/setxattr for the CIFSACL xattr
    which would unconditionally call cifs_get_acl and cifs_set_acl (even when
    mounted smb2). I made those protocol independent last week (new protocol
    version operations "get_acl" and "set_acl" but did not add an
    smb2_get_acl and smb2_set_acl yet so those now simply return EOPNOTSUPP
    which at least is better than sending cifs requests on smb2 mount)

    The previous patches did not fix the one remaining case though ie
    mounting with "cifsacl" when getting mode from acl would unconditionally
    end up calling "cifs_get_acl_from_fid" even for smb2 - so made that protocol
    independent but to make that protocol independent had to make sure that the callers
    were passing the protocol independent handle structure (cifs_fid) instead
    of cifs specific _u16 network file handle (ie cifs_fid instead of cifs_fid->fid)

    Now mount with smb2 and cifsacl mount options will return EOPNOTSUP (instead
    of timing out) and a future patch will add smb2 operations (e.g. get_smb2_acl)
    to enable this.

    Signed-off-by: Steve French

    Steve French
     

20 Jan, 2014

2 commits


28 Dec, 2013

1 commit

  • Set FILE_CREATED on O_CREAT|O_EXCL.

    cifs code didn't change during commit 116cc0225381415b96551f725455d067f63a76a0

    Kernel bugzilla 66251

    Signed-off-by: Shirish Pargaonkar
    Acked-by: Jeff Layton
    CC: Stable
    Signed-off-by: Steve French

    Shirish Pargaonkar
     

12 Nov, 2013

1 commit

  • Andrey reported that he was seeing cifs.ko spam the logs with messages
    like this:

    CIFS VFS: Unexpected lookup error -26

    He was listing the root directory of a server and hitting an error when
    trying to QUERY_PATH_INFO against hiberfil.sys and pagefile.sys. The
    right fix would be to switch the lookup code over to using FIND_FIRST,
    but until then we really don't need to report this at a level of
    KERN_ERR. Convert this message over to FYI level.

    Reported-by: "Andrey Shernyukov"
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

17 Sep, 2013

1 commit


09 Sep, 2013

1 commit


11 Jul, 2013

2 commits


29 Jun, 2013

1 commit

  • Instances either don't look at it at all (the majority of cases) or
    only want it to find the superblock (which can be had as dentry->d_sb).
    A few cases that want more are actually safe with dentry->d_inode -
    the only precaution needed is the check that it hadn't been replaced with
    NULL by rmdir() or by overwriting rename(), which case should be simply
    treated as cache miss.

    Signed-off-by: Linus Torvalds
    Signed-off-by: Al Viro

    Linus Torvalds
     

05 May, 2013

2 commits

  • Fix to return a negative error code from the error handling
    case instead of 0, as returned elsewhere in this function.

    Signed-off-by: Wei Yongjun
    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French
    Signed-off-by: Steve French

    Wei Yongjun
     
  • It's not obvious from reading the macro names that these macros
    are for debugging. Convert the names to a single more typical
    kernel style cifs_dbg macro.

    cERROR(1, ...) -> cifs_dbg(VFS, ...)
    cFYI(1, ...) -> cifs_dbg(FYI, ...)
    cFYI(DBG2, ...) -> cifs_dbg(NOISY, ...)

    Move the terminating format newline from the macro to the call site.

    Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the
    "CIFS VFS: " prefix for VFS messages.

    Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y)

    $ size fs/cifs/cifs.ko*
    text data bss dec hex filename
    265245 2525 132 267902 4167e fs/cifs/cifs.ko.new
    268359 2525 132 271016 422a8 fs/cifs/cifs.ko.old

    Other miscellaneous changes around these conversions:

    o Miscellaneous typo fixes
    o Add terminating \n's to almost all formats and remove them
    from the macros to be more kernel style like. A few formats
    previously had defective \n's
    o Remove unnecessary OOM messages as kmalloc() calls dump_stack
    o Coalesce formats to make grep easier,
    added missing spaces when coalescing formats
    o Use %s, __func__ instead of embedded function name
    o Removed unnecessary "cifs: " prefixes
    o Convert kzalloc with multiply to kcalloc
    o Remove unused cifswarn macro

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

    Joe Perches
     

13 Feb, 2013

1 commit


12 Dec, 2012

1 commit

  • Currently the code takes care to ensure that the prefixpath has a
    leading '/' delimiter. What if someone passes us a prefixpath with a
    leading '\\' instead? The code doesn't properly handle that currently
    AFAICS.

    Let's just change the code to skip over any leading delimiter character
    when copying the prepath. Then, fix up the users of the prepath option
    to prefix it with the correct delimiter when they use it.

    Also, there's no need to limit the length of the prefixpath to 1k. If
    the server can handle it, why bother forbidding it?

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

    Jeff Layton
     

06 Dec, 2012

1 commit


05 Nov, 2012

1 commit

  • We do not need to lookup a hashed negative directory since we have
    already revalidated it before and have found it to be fine.

    This also prevents a crash in cifs_lookup() when it attempts to rehash
    the already hashed negative lookup dentry.

    The patch has been tested using the reproducer at
    https://bugzilla.redhat.com/show_bug.cgi?id=867344#c28

    Cc: # 3.6.x
    Reported-by: Vit Zahradka
    Signed-off-by: Sachin Prabhu

    Sachin Prabhu
     

25 Sep, 2012

4 commits


20 Aug, 2012

1 commit

  • Commit d2c127197dfc0b2bae62a52e1e0d3e3ff493919e caused a regression
    in cifs_do_create error handling. Fix this by closing a file handle
    in the case of a get_inode_info(_unix) error. Also remove unnecessary
    checks for newinode being NULL.

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

    Pavel Shilovsky
     

25 Jul, 2012

2 commits


24 Jul, 2012

1 commit


14 Jul, 2012

2 commits

  • boolean "does it have to be exclusive?" flag is passed instead;
    Local filesystem should just ignore it - the object is guaranteed
    not to be there yet.

    Signed-off-by: Al Viro

    Al Viro
     
  • Just the flags; only NFS cares even about that, but there are
    legitimate uses for such argument. And getting rid of that
    completely would require splitting ->lookup() into a couple
    of methods (at least), so let's leave that alone for now...

    Signed-off-by: Al Viro

    Al Viro