08 Oct, 2016

1 commit


22 Sep, 2016

1 commit

  • inode_change_ok() will be resposible for clearing capabilities and IMA
    extended attributes and as such will need dentry. Give it as an argument
    to inode_change_ok() instead of an inode. Also rename inode_change_ok()
    to setattr_prepare() to better relect that it does also some
    modifications in addition to checks.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Jan Kara
     

16 Sep, 2016

1 commit


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
     

03 May, 2016

1 commit


11 Apr, 2016

1 commit


05 Apr, 2016

1 commit

  • PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
    ago with promise that one day it will be possible to implement page
    cache with bigger chunks than PAGE_SIZE.

    This promise never materialized. And unlikely will.

    We have many places where PAGE_CACHE_SIZE assumed to be equal to
    PAGE_SIZE. And it's constant source of confusion on whether
    PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
    especially on the border between fs and mm.

    Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
    breakage to be doable.

    Let's stop pretending that pages in page cache are special. They are
    not.

    The changes are pretty straight-forward:

    - << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};

    - page_cache_get() -> get_page();

    - page_cache_release() -> put_page();

    This patch contains automated changes generated with coccinelle using
    script below. For some reason, coccinelle doesn't patch header files.
    I've called spatch for them manually.

    The only adjustment after coccinelle is revert of changes to
    PAGE_CAHCE_ALIGN definition: we are going to drop it later.

    There are few places in the code where coccinelle didn't reach. I'll
    fix them manually in a separate patch. Comments and documentation also
    will be addressed with the separate patch.

    virtual patch

    @@
    expression E;
    @@
    - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    expression E;
    @@
    - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    @@
    - PAGE_CACHE_SHIFT
    + PAGE_SHIFT

    @@
    @@
    - PAGE_CACHE_SIZE
    + PAGE_SIZE

    @@
    @@
    - PAGE_CACHE_MASK
    + PAGE_MASK

    @@
    expression E;
    @@
    - PAGE_CACHE_ALIGN(E)
    + PAGE_ALIGN(E)

    @@
    expression E;
    @@
    - page_cache_get(E)
    + get_page(E)

    @@
    expression E;
    @@
    - page_cache_release(E)
    + put_page(E)

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

15 Jan, 2016

1 commit

  • Commit 7196ac113a4f ("Fix to check Unique id and FileType when client
    refer file directly.") checks whether the uniqueid of an inode has
    changed when getting the inode info, but only when using the UNIX
    extensions. Add a similar check for SMB2+, since this can be done
    without an extra network roundtrip.

    Signed-off-by: Ross Lagerwall
    Signed-off-by: Steve French

    Ross Lagerwall
     

14 Dec, 2015

1 commit

  • Jan Stancek reported that I wrecked things for him by fixing things for
    Vladimir :/

    His report was due to an UNINTERRUPTIBLE wait getting -EINTR, which
    should not be possible, however my previous patch made this possible by
    unconditionally checking signal_pending().

    We cannot use current->state as was done previously, because the
    instruction after the store to that variable it can be changed. We must
    instead pass the initial state along and use that.

    Fixes: 68985633bccb ("sched/wait: Fix signal handling in bit wait helpers")
    Reported-by: Jan Stancek
    Reported-by: Chris Mason
    Tested-by: Jan Stancek
    Tested-by: Vladimir Murzin
    Tested-by: Chris Mason
    Reviewed-by: Paul Turner
    Cc: Ingo Molnar
    Cc: tglx@linutronix.de
    Cc: Oleg Nesterov
    Cc: hpa@zytor.com
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

02 Oct, 2015

1 commit

  • The error paths in set_file_size for cifs and smb3 are incorrect.

    In the unlikely event that a server did not support set file info
    of the file size, the code incorrectly falls back to trying SMBWriteX
    (note that only the original core SMB Write, used for example by DOS,
    can set the file size this way - this actually does not work for the more
    recent SMBWriteX). The idea was since the old DOS SMB Write could set
    the file size if you write zero bytes at that offset then use that if
    server rejects the normal set file info call.

    Fortunately the SMBWriteX will never be sent on the wire (except when
    file size is zero) since the length and offset fields were reversed
    in the two places in this function that call SMBWriteX causing
    the fall back path to return an error. It is also important to never call
    an SMB request from an SMB2/sMB3 session (which theoretically would
    be possible, and can cause a brief session drop, although the client
    recovers) so this should be fixed. In practice this path does not happen
    with modern servers but the error fall back to SMBWriteX is clearly wrong.

    Removing the calls to SMBWriteX in the error paths in cifs_set_file_size

    Pointed out by PaX/grsecurity team

    Signed-off-by: Steve French
    Reported-by: PaX Team
    CC: Emese Revfy
    CC: Brad Spengler
    CC: Stable

    Steve French
     

21 May, 2015

1 commit

  • When you refer file directly on cifs client,
    (e.g. ls -li , cd , stat )
    the function return old inode number and filetype from old inode cache,
    though server has different inode number or filetype.

    When server is Windows, cifs client has same problem.
    When Server is Windows
    , This patch fixes bug in different filetype,
    but does not fix bug in different inode number.
    Because QUERY_PATH_INFO response by Windows does not include inode number(Index Number) .

    BUG INFO
    https://bugzilla.kernel.org/show_bug.cgi?id=90021
    https://bugzilla.kernel.org/show_bug.cgi?id=90031

    Reported-by: Nakajima Akira
    Signed-off-by: Nakajima Akira
    Reviewed-by: Shirish Pargaonkar
    Signed-off-by: Steve French

    Nakajima Akira
     

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


01 Apr, 2015

1 commit

  • Coverity reports a warning due to unitialized attr structure in one
    code path.

    Reported by Coverity (CID 728535)

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

    Steve French
     

21 Jan, 2015

1 commit

  • Now that we never use the backing_dev_info pointer in struct address_space
    we can simply remove it and save 4 to 8 bytes in every inode.

    Signed-off-by: Christoph Hellwig
    Acked-by: Ryusuke Konishi
    Reviewed-by: Tejun Heo
    Reviewed-by: Jan Kara
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

04 Nov, 2014

1 commit


17 Oct, 2014

3 commits

  • Mac server returns that they support CIFS Unix Extensions but
    doesn't actually support QUERY_FILE_UNIX_BASIC so mount fails.

    Workaround this problem by disabling use of Unix CIFS protocol
    extensions if server returns an EOPNOTSUPP error on
    QUERY_FILE_UNIX_BASIC during mount.

    Signed-off-by: Steve French

    Steve French
     
  • This is a bigger patch, but its size is mostly due to
    a single change for how we check for remapping illegal characters
    in file names - a lot of repeated, small changes to
    the way callers request converting file names.

    The final patch in the series does the following:

    1) changes default behavior for cifs to be more intuitive.
    Currently we do not map by default to seven reserved characters,
    ie those valid in POSIX but not in NTFS/CIFS/SMB3/Windows,
    unless a mount option (mapchars) is specified. Change this
    to by default always map and map using the SFM maping
    (like the Mac uses) unless the server negotiates the CIFS Unix
    Extensions (like Samba does when mounting with the cifs protocol)
    when the remapping of the characters is unnecessary. This should
    help SMB3 mounts in particular since Samba will likely be
    able to implement this mapping with its new "vfs_fruit" module
    as it will be doing for the Mac.
    2) if the user specifies the existing "mapchars" mount option then
    use the "SFU" (Microsoft Services for Unix, SUA) style mapping of
    the seven characters instead.
    3) if the user specifies "nomapposix" then disable SFM/MAC style mapping
    (so no character remapping would be used unless the user specifies
    "mapchars" on mount as well, as above).
    4) change all the places in the code that check for the superblock
    flag on the mount which is set by mapchars and passed in on all
    path based operation and change it to use a small function call
    instead to set the mapping type properly (and check for the
    mapping type in the cifs unicode functions)

    Signed-off-by: Steve French

    Steve French
     
  • 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

  • CIFS servers process nlink counts differently for files and directories.
    In cifs_rename() if we the request fails on the existing target, we
    try to remove it through cifs_unlink() but this is not what we want
    to do for directories. As the result the following sequence of commands

    mkdir {1,2}; mv -T 1 2; rmdir {1,2}; mkdir {1,2}; echo foo > 2/bar

    and XFS test generic/023 fail with -ENOENT error. That's why the second
    mkdir reuses the existing inode (target inode of the mv -T command) with
    S_DEAD flag.

    Fix this by checking whether the target is directory or not and
    calling cifs_rmdir() rather than cifs_unlink() for directories.

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

    Pavel Shilovsky
     

21 Aug, 2014

1 commit

  • Pull cifs fixes from Steve French:
    "Most important fixes in this set include three SMB3 fixes for stable
    (including fix for possible kernel oops), and a workaround to allow
    writes to Mac servers (only cifs dialect, not more current SMB2.1,
    worked to Mac servers). Also fallocate support added, and lease fix
    from Jeff"

    * 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
    [SMB3] Enable fallocate -z support for SMB3 mounts
    enable fallocate punch hole ("fallocate -p") for SMB3
    Incorrect error returned on setting file compressed on SMB2
    CIFS: Fix wrong directory attributes after rename
    CIFS: Fix SMB2 readdir error handling
    [CIFS] Possible null ptr deref in SMB2_tcon
    [CIFS] Workaround MacOS server problem with SMB2.1 write response
    cifs: handle lease F_UNLCK requests properly
    Cleanup sparse file support by creating worker function for it
    Add sparse file support to SMB2/SMB3 mounts
    Add missing definitions for CIFS File System Attributes
    cifs: remove unused function cifs_oplock_break_wait

    Linus Torvalds
     

17 Aug, 2014

1 commit

  • When we requests rename we also need to update attributes
    of both source and target parent directories. Not doing it
    causes generic/309 xfstest to fail on SMB2 mounts. Fix this
    by marking these directories for force revalidating.

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

    Pavel Shilovsky
     

12 Aug, 2014

1 commit

  • Pull vfs updates from Al Viro:
    "Stuff in here:

    - acct.c fixes and general rework of mnt_pin mechanism. That allows
    to go for delayed-mntput stuff, which will permit mntput() on deep
    stack without worrying about stack overflows - fs shutdown will
    happen on shallow stack. IOW, we can do Eric's umount-on-rmdir
    series without introducing tons of stack overflows on new mntput()
    call chains it introduces.
    - Bruce's d_splice_alias() patches
    - more Miklos' rename() stuff.
    - a couple of regression fixes (stable fodder, in the end of branch)
    and a fix for API idiocy in iov_iter.c.

    There definitely will be another pile, maybe even two. I'd like to
    get Eric's series in this time, but even if we miss it, it'll go right
    in the beginning of for-next in the next cycle - the tricky part of
    prereqs is in this pile"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (40 commits)
    fix copy_tree() regression
    __generic_file_write_iter(): fix handling of sync error after DIO
    switch iov_iter_get_pages() to passing maximal number of pages
    fs: mark __d_obtain_alias static
    dcache: d_splice_alias should detect loops
    exportfs: update Exporting documentation
    dcache: d_find_alias needn't recheck IS_ROOT && DCACHE_DISCONNECTED
    dcache: remove unused d_find_alias parameter
    dcache: d_obtain_alias callers don't all want DISCONNECTED
    dcache: d_splice_alias should ignore DCACHE_DISCONNECTED
    dcache: d_splice_alias mustn't create directory aliases
    dcache: close d_move race in d_splice_alias
    dcache: move d_splice_alias
    namei: trivial fix to vfs_rename_dir comment
    VFS: allow ->d_manage() to declare -EISDIR in rcu_walk mode.
    cifs: support RENAME_NOREPLACE
    hostfs: support rename flags
    shmem: support RENAME_EXCHANGE
    shmem: support RENAME_NOREPLACE
    btrfs: add RENAME_NOREPLACE
    ...

    Linus Torvalds
     

08 Aug, 2014

1 commit

  • This flag gives CIFS the ability to support its native rename semantics.

    Implementation is simple: just bail out before trying to hack around the
    noreplace semantics.

    Signed-off-by: Miklos Szeredi
    Cc: Steve French
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Miklos Szeredi
     

16 Jul, 2014

2 commits

  • It is currently not possible for various wait_on_bit functions
    to implement a timeout.

    While the "action" function that is called to do the waiting
    could certainly use schedule_timeout(), there is no way to carry
    forward the remaining timeout after a false wake-up.
    As false-wakeups a clearly possible at least due to possible
    hash collisions in bit_waitqueue(), this is a real problem.

    The 'action' function is currently passed a pointer to the word
    containing the bit being waited on. No current action functions
    use this pointer. So changing it to something else will be a
    little noisy but will have no immediate effect.

    This patch changes the 'action' function to take a pointer to
    the "struct wait_bit_key", which contains a pointer to the word
    containing the bit so nothing is really lost.

    It also adds a 'private' field to "struct wait_bit_key", which
    is initialized to zero.

    An action function can now implement a timeout with something
    like

    static int timed_out_waiter(struct wait_bit_key *key)
    {
    unsigned long waited;
    if (key->private == 0) {
    key->private = jiffies;
    if (key->private == 0)
    key->private -= 1;
    }
    waited = jiffies - key->private;
    if (waited > 10 * HZ)
    return -EAGAIN;
    schedule_timeout(waited - 10 * HZ);
    return 0;
    }

    If any other need for context in a waiter were found it would be
    easy to use ->private for some other purpose, or even extend
    "struct wait_bit_key".

    My particular need is to support timeouts in nfs_release_page()
    to avoid deadlocks with loopback mounted NFS.

    While wait_on_bit_timeout() would be a cleaner interface, it
    will not meet my need. I need the timeout to be sensitive to
    the state of the connection with the server, which could change.
    So I need to use an 'action' interface.

    Signed-off-by: NeilBrown
    Acked-by: Peter Zijlstra
    Cc: Oleg Nesterov
    Cc: Steve French
    Cc: David Howells
    Cc: Steven Whitehouse
    Cc: Linus Torvalds
    Link: http://lkml.kernel.org/r/20140707051604.28027.41257.stgit@notabene.brown
    Signed-off-by: Ingo Molnar

    NeilBrown
     
  • The current "wait_on_bit" interface requires an 'action'
    function to be provided which does the actual waiting.
    There are over 20 such functions, many of them identical.
    Most cases can be satisfied by one of just two functions, one
    which uses io_schedule() and one which just uses schedule().

    So:
    Rename wait_on_bit and wait_on_bit_lock to
    wait_on_bit_action and wait_on_bit_lock_action
    to make it explicit that they need an action function.

    Introduce new wait_on_bit{,_lock} and wait_on_bit{,_lock}_io
    which are *not* given an action function but implicitly use
    a standard one.
    The decision to error-out if a signal is pending is now made
    based on the 'mode' argument rather than being encoded in the action
    function.

    All instances of the old wait_on_bit and wait_on_bit_lock which
    can use the new version have been changed accordingly and their
    action functions have been discarded.
    wait_on_bit{_lock} does not return any specific error code in the
    event of a signal so the caller must check for non-zero and
    interpolate their own error code as appropriate.

    The wait_on_bit() call in __fscache_wait_on_invalidate() was
    ambiguous as it specified TASK_UNINTERRUPTIBLE but used
    fscache_wait_bit_interruptible as an action function.
    David Howells confirms this should be uniformly
    "uninterruptible"

    The main remaining user of wait_on_bit{,_lock}_action is NFS
    which needs to use a freezer-aware schedule() call.

    A comment in fs/gfs2/glock.c notes that having multiple 'action'
    functions is useful as they display differently in the 'wchan'
    field of 'ps'. (and /proc/$PID/wchan).
    As the new bit_wait{,_io} functions are tagged "__sched", they
    will not show up at all, but something higher in the stack. So
    the distinction will still be visible, only with different
    function names (gds2_glock_wait versus gfs2_glock_dq_wait in the
    gfs2/glock.c case).

    Since first version of this patch (against 3.15) two new action
    functions appeared, on in NFS and one in CIFS. CIFS also now
    uses an action function that makes the same freezer aware
    schedule call as NFS.

    Signed-off-by: NeilBrown
    Acked-by: David Howells (fscache, keys)
    Acked-by: Steven Whitehouse (gfs2)
    Acked-by: Peter Zijlstra
    Cc: Oleg Nesterov
    Cc: Steve French
    Cc: Linus Torvalds
    Link: http://lkml.kernel.org/r/20140707051603.28027.72349.stgit@notabene.brown
    Signed-off-by: Ingo Molnar

    NeilBrown
     

10 Jun, 2014

1 commit

  • Pull CIFS fixes from Steve French.

    * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
    CIFS: Fix memory leaks in SMB2_open
    cifs: ensure that vol->username is not NULL before running strlen on it
    Clarify SMB2/SMB3 create context and add missing ones
    Do not send ClientGUID on SMB2.02 dialect
    cifs: Set client guid on per connection basis
    fs/cifs/netmisc.c: convert printk to pr_foo()
    fs/cifs/cifs.c: replace seq_printf by seq_puts
    Update cifs version number to 2.03
    fs: cifs: new helper: file_inode(file)
    cifs: fix potential races in cifs_revalidate_mapping
    cifs: new helper function: cifs_revalidate_mapping
    cifs: convert booleans in cifsInodeInfo to a flags field
    cifs: fix cifs_uniqueid_to_ino_t not to ever return 0

    Linus Torvalds
     

22 May, 2014

3 commits

  • The handling of the CIFS_INO_INVALID_MAPPING flag is racy. It's possible
    for two tasks to attempt to revalidate the mapping at the same time. The
    first sees that CIFS_INO_INVALID_MAPPING is set. It clears the flag and
    then calls invalidate_inode_pages2 to start shooting down the pagecache.

    While that's going on, another task checks the flag and sees that it's
    clear. It then ends up trusting the pagecache to satisfy a read when it
    shouldn't.

    Fix this by adding a bitlock to ensure that the clearing of the flag is
    atomic with respect to the actual cache invalidation. Also, move the
    other existing users of cifs_invalidate_mapping to use a new
    cifs_zap_mapping() function that just sets the INVALID_MAPPING bit and
    then uses the standard codepath to handle the invalidation.

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

    Jeff Layton
     
  • Consolidate a bit of code. In a later patch we'll expand this to fix
    some races.

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

    Jeff Layton
     
  • In later patches, we'll need to have a bitlock, so go ahead and convert
    these bools to use atomic bitops instead.

    Also, clean up the initialization of the flags field. There's no need
    to unset each bit individually just after it was zeroed on allocation.

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

    Jeff Layton
     

25 Apr, 2014

1 commit

  • actimeo=0 is supposed to be a special case that ensures that inode
    attributes are always refetched from the server instead of trusting the
    cache. The cifs code however uses time_in_range() to determine whether
    the attributes have timed out. In the case where cifs_i->time equals
    jiffies, this leads to the cifs code not refetching the inode attributes
    when it should.

    Fix this by explicitly testing for actimeo=0, and handling it as a
    special case.

    Reported-and-tested-by: Tetsuo Handa
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

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
     

08 Feb, 2014

1 commit

  • Changeset 666753c3ef8fc88b0ddd5be4865d0aa66428ac35 added protocol
    operations for get/setxattr to avoid calling cifs operations
    on smb2/smb3 mounts for xattr operations and this changeset
    adds the calls to cifs specific protocol operations for xattrs
    (in order to reenable cifs support for xattrs which was
    temporarily disabled by the previous changeset. We do not
    have SMB2/SMB3 worker function for setting xattrs yet so
    this only enables it for cifs.

    CCing stable since without these two small changsets (its
    small coreq 666753c3ef8fc88b0ddd5be4865d0aa66428ac35 is
    also needed) calling getfattr/setfattr on smb2/smb3 mounts
    causes problems.

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

    Steve French
     

20 Jan, 2014

3 commits


28 Dec, 2013

1 commit

  • When we obtain tcon from cifs_sb, we use cifs_sb_tlink() to first obtain
    tlink which also grabs a reference to it. We do not drop this reference
    to tlink once we are done with the call.

    The patch fixes this issue by instead passing tcon as a parameter and
    avoids having to obtain a reference to the tlink. A lookup for the tcon
    is already made in the calling functions and this way we avoid having to
    re-run the lookup. This is also consistent with the argument list for
    other similar calls for M-F symlinks.

    We should also return an ENOSYS when we do not find a protocol specific
    function to lookup the MF Symlink data.

    Signed-off-by: Sachin Prabhu
    Reviewed-by: Jeff Layton
    CC: Stable
    Signed-off-by: Steve French

    Sachin Prabhu
     

12 Nov, 2013

1 commit

  • Now we treat any reparse point as a symbolic link and map it to a Unix
    one that is not true in a common case due to many reparse point types
    supported by SMB servers.

    Distinguish reparse point types into two groups:
    1) that can be accessed directly through a reparse point
    (junctions, deduplicated files, NFS symlinks);
    2) that need to be processed manually (Windows symbolic links, DFS);

    and map only Windows symbolic links to Unix ones.

    Cc:
    Acked-by: Jeff Layton
    Reported-and-tested-by: Joao Correia
    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Pavel Shilovsky
     

21 Sep, 2013

1 commit

  • Since we don't get info about the number of links from the readdir
    linfo levels, stat() will return 0 for st_nlink, and in particular,
    samba re-exported shares will show directories as files (as samba is
    keying off st_nlink before evaluating how to set the dos modebits)
    when doing a dir or ls.

    Copy nlink to the inode, unless it wasn't provided. Provide
    sane values if we don't have an existing one and none was provided.

    Signed-off-by: Jim McDonough
    Reviewed-by: Jeff Layton
    Reviewed-by: David Disseldorp
    Signed-off-by: Steve French

    Jim McDonough