03 Oct, 2014

1 commit

  • Changeset eb85d94bd introduced a problem where if a cifs open
    fails during query info of a file we
    will still try to close the file (happens with certain types
    of reparse points) even though the file handle is not valid.

    In addition for SMB2/SMB3 we were not mapping the return code returned
    by Windows when trying to open a file (like a Windows NFS symlink)
    which is a reparse point.

    Signed-off-by: Steve French
    Reviewed-by: Pavel Shilovsky
    CC: stable #v3.13+

    Steve French
     

18 Aug, 2014

1 commit

  • When the server (for an SMB2 or SMB3 mount) doesn't support
    an ioctl (such as setting the compressed flag
    on a file) we were incorrectly returning EIO instead
    of EOPNOTSUPP, this is confusing e.g. doing chattr +c to a file
    on a non-btrfs Samba partition, now the error returned is more
    intuitive to the user. Also fixes error mapping on setting
    hardlink to servers which don't support that.

    Signed-off-by: Steve French
    Reviewed-by: David Disseldorp

    Steve French
     

17 Aug, 2014

1 commit

  • SMB2 servers indicates the end of a directory search with
    STATUS_NO_MORE_FILE error code that is not processed now.
    This causes generic/257 xfstest to fail. Fix this by triggering
    the end of search by this error code in SMB2_query_directory.

    Also when negotiating CIFS protocol we tell the server to close
    the search automatically at the end and there is no need to do
    it itself. In the case of SMB2 protocol, we need to close it
    explicitly - separate close directory checks for different
    protocols.

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

    Pavel Shilovsky
     

02 Aug, 2014

1 commit

  • The existing mapping causes unlink() call to return error after delete
    operation. Changing the mapping to -EACCES makes the client process
    the call like CIFS protocol does - reset dos attributes with ATTR_READONLY
    flag masked off and retry the operation.

    Cc: stable@vger.kernel.org
    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Pavel Shilovsky
     

12 Nov, 2013

1 commit

  • Sometimes, the server will report an error that basically indicates
    that it's running out of resources. These include these under SMB1:

    NT_STATUS_NO_MEMORY
    NT_STATUS_SECTION_TOO_BIG
    NT_STATUS_TOO_MANY_PAGING_FILES

    ...and this one under SMB2:

    STATUS_NO_MEMORY

    Currently, this gets mapped to ENOMEM by the client, but that's
    confusing as an ENOMEM error is typically an indicator that the
    client is out of memory.

    Change these errors to instead map to EREMOTEIO to indicate that
    the problem is actually server-side and not on the client.

    Reported-by: "ISHIKAWA,chiaki"
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

05 May, 2013

1 commit

  • 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
     

27 Sep, 2012

1 commit

  • ERRnoresource is an ERRSRV level (aka server-side) error and means "No
    resources currently available for request". Currently that maps to POSIX
    -ENOBUFS. No NT errors map to it currently.

    NT_STATUS_INSUFFICIENT_RESOURCES and NT_STATUS_INSUFF_SERVER_RESOURCES
    are also similar in meaning. Currently the client maps those to
    ERRnomem, which maps to -ENOMEM in POSIX.

    All of these mappings seem to be quite wrong to me and are confusing for
    users. All of the above errors indicate problems on the server, not the
    client. Reporting -ENOMEM or -ENOBUFS implies that the client is running
    out of resources.

    This patch changes those mappings. The NT_* errors are changed to map to
    the SRV level ERRnoresource. That error is in turn changed to return
    -EREMOTEIO which is the only POSIX error I could find that conveys that
    something went wrong on the server. While we're at it, change the SMB2
    equivalent error to return the same.

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

    Jeff Layton
     

25 Sep, 2012

1 commit


24 Jul, 2012

1 commit

  • Add mapping table for 32 bit SMB2 status codes to linux errors.
    Note that SMB2 does not use DOS/OS2 errors (ever) so mapping to
    DOS/OS2 errors as a common network subset (as we do for cifs)
    doesn't help. And note that the set of status codes is much more
    complete here.

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

    Steve French