21 May, 2011

7 commits

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
    [IA64] define "_sdata" symbol
    pstore: Fix Kconfig dependencies for apei->pstore
    pstore: fix potential logic issue in pstore read interface
    pstore: fix pstore filesystem mount/remount issue
    pstore: fix one type of return value in pstore
    [IA64] fix build warning in arch/ia64/oprofile/backtrace.c

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (32 commits)
    [CIFS] Fix to problem with getattr caused by invalidate simplification patch
    [CIFS] Remove sparse warning
    [CIFS] Update cifs to version 1.72
    cifs: Change key name to cifs.idmap, misc. clean-up
    cifs: Unconditionally copy mount options to superblock info
    cifs: Use kstrndup for cifs_sb->mountdata
    cifs: Simplify handling of submount options in cifs_mount.
    cifs: cifs_parse_mount_options: do not tokenize mount options in-place
    cifs: Add support for mounting Windows 2008 DFS shares
    cifs: Extract DFS referral expansion logic to separate function
    cifs: turn BCC into a static inlined function
    cifs: keep BCC in little-endian format
    cifs: fix some unused variable warnings in id_rb_search
    CIFS: Simplify invalidate part (try #5)
    CIFS: directio read/write cleanups
    consistently use smb_buf_length as be32 for cifs (try 3)
    cifs: Invoke id mapping functions (try #17 repost)
    cifs: Add idmap key and related data structures and functions (try #17 repost)
    CIFS: Add launder_page operation (try #3)
    Introduce smb2 mounts as vers=2
    ...

    Linus Torvalds
     
  • * 'ptrace' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc: (41 commits)
    signal: trivial, fix the "timespec declared inside parameter list" warning
    job control: reorganize wait_task_stopped()
    ptrace: fix signal->wait_chldexit usage in task_clear_group_stop_trapping()
    signal: sys_sigprocmask() needs retarget_shared_pending()
    signal: cleanup sys_sigprocmask()
    signal: rename signandsets() to sigandnsets()
    signal: do_sigtimedwait() needs retarget_shared_pending()
    signal: introduce do_sigtimedwait() to factor out compat/native code
    signal: sys_rt_sigtimedwait: simplify the timeout logic
    signal: cleanup sys_rt_sigprocmask()
    x86: signal: sys_rt_sigreturn() should use set_current_blocked()
    x86: signal: handle_signal() should use set_current_blocked()
    signal: sigprocmask() should do retarget_shared_pending()
    signal: sigprocmask: narrow the scope of ->siglock
    signal: retarget_shared_pending: optimize while_each_thread() loop
    signal: retarget_shared_pending: consider shared/unblocked signals only
    signal: introduce retarget_shared_pending()
    ptrace: ptrace_check_attach() should not do s/STOPPED/TRACED/
    signal: Turn SIGNAL_STOP_DEQUEUED into GROUP_STOP_DEQUEUED
    signal: do_signal_stop: Remove the unneeded task_clear_group_stop_pending()
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (32 commits)
    GFS2: Move all locking inside the inode creation function
    GFS2: Clean up symlink creation
    GFS2: Clean up mkdir
    GFS2: Use UUID field in generic superblock
    GFS2: Rename ops_inode.c to inode.c
    GFS2: Inode.c is empty now, remove it
    GFS2: Move final part of inode.c into super.c
    GFS2: Move most of the remaining inode.c into ops_inode.c
    GFS2: Move gfs2_refresh_inode() and friends into glops.c
    GFS2: Remove gfs2_dinode_print() function
    GFS2: When adding a new dir entry, inc link count if it is a subdir
    GFS2: Make gfs2_dir_del update link count when required
    GFS2: Don't use gfs2_change_nlink in link syscall
    GFS2: Don't use a try lock when promoting to a higher mode
    GFS2: Double check link count under glock
    GFS2: Improve bug trap code in ->releasepage()
    GFS2: Fix ail list traversal
    GFS2: make sure fallocate bytes is a multiple of blksize
    GFS2: Add an AIL writeback tracepoint
    GFS2: Make writeback more responsive to system conditions
    ...

    Linus Torvalds
     
  • Commit e66eed651fd1 ("list: remove prefetching from regular list
    iterators") removed the include of prefetch.h from list.h, which
    uncovered several cases that had apparently relied on that rather
    obscure header file dependency.

    So this fixes things up a bit, using

    grep -L linux/prefetch.h $(git grep -l '[^a-z_]prefetchw*(' -- '*.[ch]')
    grep -L 'prefetchw*(' $(git grep -l 'linux/prefetch.h' -- '*.[ch]')

    to guide us in finding files that either need
    inclusion, or have it despite not needing it.

    There are more of them around (mostly network drivers), but this gets
    many core ones.

    Reported-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Tony Luck
     
  • Fix to earlier "Simplify invalidate part (try #6)" patch
    That patch caused problems with connectathon test 5.

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

    Steve French
     

20 May, 2011

1 commit

  • …/gregkh/driver-core-2.6

    * 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (44 commits)
    debugfs: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning
    sysfs: remove "last sysfs file:" line from the oops messages
    drivers/base/memory.c: fix warning due to "memory hotplug: Speed up add/remove when blocks are larger than PAGES_PER_SECTION"
    memory hotplug: Speed up add/remove when blocks are larger than PAGES_PER_SECTION
    SYSFS: Fix erroneous comments for sysfs_update_group().
    driver core: remove the driver-model structures from the documentation
    driver core: Add the device driver-model structures to kerneldoc
    Translated Documentation/email-clients.txt
    RAW driver: Remove call to kobject_put().
    reboot: disable usermodehelper to prevent fs access
    efivars: prevent oops on unload when efi is not enabled
    Allow setting of number of raw devices as a module parameter
    Introduce CONFIG_GOOGLE_FIRMWARE
    driver: Google Memory Console
    driver: Google EFI SMI
    x86: Better comments for get_bios_ebda()
    x86: get_bios_ebda_length()
    misc: fix ti-st build issues
    params.c: Use new strtobool function to process boolean inputs
    debugfs: move to new strtobool
    ...

    Fix up trivial conflicts in fs/debugfs/file.c due to the same patch
    being applied twice, and an unrelated cleanup nearby.

    Linus Torvalds
     

19 May, 2011

32 commits

  • Move extern for cifsConvertToUCS to different header to prevent following warning:

    CHECK fs/cifs/cifs_unicode.c
    fs/cifs/cifs_unicode.c:267:1: warning: symbol 'cifsConvertToUCS' was not declared. Should it be static?

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

    Steve French
     
  • Signed-off-by: Steve French

    Steve French
     
  • Change idmap key name from cifs.cifs_idmap to cifs.idmap.
    Removed unused structure wksidarr and function match_sid().
    Handle errors correctly in function init_cifs().

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

    Shirish Pargaonkar
     
  • Previously mount options were copied and updated in the cifs_sb_info
    struct only when CONFIG_CIFS_DFS_UPCALL was enabled. Making this
    information generally available allows us to remove a number of ifdefs,
    extra function params, and temporary variables.

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

    Sean Finney
     
  • A relatively minor nit, but also clarified the "consensus" from the
    preceding comments that it is in fact better to try for the kstrdup
    early and cleanup while cleaning up is still a simple thing to do.

    Reviewed-By: Steve French
    Signed-off-by: Sean Finney
    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Sean Finney
     
  • With CONFIG_DFS_UPCALL enabled, maintain the submount options in
    cifs_sb->mountdata, simplifying the code just a bit as well as making
    corner-case allocation problems less likely.

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

    Sean Finney
     
  • To keep strings passed to cifs_parse_mount_options re-usable (which is
    needed to clean up the DFS referral handling), tokenize a copy of the
    mount options instead. If values are needed from this tokenized string,
    they too must be duplicated (previously, some options were copied and
    others duplicated).

    Since we are not on the critical path and any cleanup is relatively easy,
    the extra memory usage shouldn't be a problem (and it is a bit simpler
    than trying to implement something smarter).

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

    Sean Finney
     
  • Windows 2008 CIFS servers do not always return PATH_NOT_COVERED when
    attempting to access a DFS share. Therefore, when checking for remote
    shares, unconditionally ask for a DFS referral for the UNC (w/out prepath)
    before continuing with previous behavior of attempting to access the UNC +
    prepath and checking for PATH_NOT_COVERED.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=31092

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

    Sean Finney
     
  • The logic behind the expansion of DFS referrals is now extracted from
    cifs_mount into a new static function, expand_dfs_referral. This will
    reduce duplicate code in upcoming commits.

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

    Sean Finney
     
  • It's a bad idea to have macro functions that reference variables more
    than once, as the arguments could have side effects. Turn BCC() into
    a static inlined function instead.

    While we're at it, make it return a void * to discourage anyone from
    dereferencing it as-is.

    Reported-and-acked-by: David Howells
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French
    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Jeff Layton
     
  • This is the same patch as originally posted, just with some merge
    conflicts fixed up...

    Currently, the ByteCount is usually converted to host-endian on receive.
    This is confusing however, as we need to keep two sets of routines for
    accessing it, and keep track of when to use each routine. Munging
    received packets like this also limits when the signature can be
    calulated.

    Simplify the code by keeping the received ByteCount in little-endian
    format. This allows us to eliminate a set of routines for accessing it
    and we can now drop the *_le suffixes from the accessor functions since
    that's now implied.

    While we're at it, switch all of the places that read the ByteCount
    directly to use the get_bcc inline which should also clean up some
    unaligned accesses.

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

    Jeff Layton
     
  • fs/cifs/cifsacl.c: In function ‘id_rb_search’:
    fs/cifs/cifsacl.c:215:19: warning: variable ‘linkto’ set but not used
    [-Wunused-but-set-variable]
    fs/cifs/cifsacl.c:214:18: warning: variable ‘parent’ set but not used
    [-Wunused-but-set-variable]

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

    Jeff Layton
     
  • Simplify many places when we call cifs_revalidate/invalidate to make
    it do what it exactly needs.

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

    Pavel Shilovsky
     
  • Recently introduced strictcache mode brought a new code that can be
    efficiently used by directio part. That's let us add vectored operations
    and break unnecessary cifs_user_read and cifs_user_write.

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

    Pavel Shilovsky
     
  • There is one big endian field in the cifs protocol, the RFC1001
    length, which cifs code (unlike in the smb2 code) had been handling as
    u32 until the last possible moment, when it was converted to be32 (its
    native form) before sending on the wire. To remove the last sparse
    endian warning, and to make this consistent with the smb2
    implementation (which always treats the fields in their
    native size and endianness), convert all uses of smb_buf_length to
    be32.

    This version incorporates Christoph's comment about
    using be32_add_cpu, and fixes a typo in the second
    version of the patch.

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

    Steve French
     
  • rb tree search and insertion routines.

    A SID which needs to be mapped, is looked up in one of the rb trees
    depending on whether SID is either owner or group SID.
    If found in the tree, a (mapped) id from that node is assigned to
    uid or gid as appropriate. If unmapped, an upcall is attempted to
    map the SID to an id. If upcall is successful, node is marked as
    mapped. If upcall fails, node stays marked as unmapped and a mapping
    is attempted again only after an arbitrary time period has passed.

    To map a SID, which can be either a Owner SID or a Group SID, key
    description starts with the string "os" or "gs" followed by SID converted
    to a string. Without "os" or "gs", cifs.upcall does not know whether
    SID needs to be mapped to either an uid or a gid.

    Nodes in rb tree have fields to prevent multiple upcalls for
    a SID. Searching, adding, and removing nodes is done within global locks.
    Whenever a node is either found or inserted in a tree, a reference
    is taken on that node.
    Shrinker routine prunes a node if it has expired but does not prune
    an expired node if its refcount is not zero (i.e. sid/id of that node
    is_being/will_be accessed).
    Thus a node, if its SID needs to be mapped by making an upcall,
    can safely stay and its fields accessed without shrinker pruning it.
    A reference (refcount) is put on the node without holding the spinlock
    but a reference is get on the node by holding the spinlock.

    Every time an existing mapped node is accessed or mapping is attempted,
    its timestamp is updated to prevent it from getting erased or a
    to prevent multiple unnecessary repeat mapping retries respectively.

    For now, cifs.upcall is only used to map a SID to an id (uid or gid) but
    it would be used to obtain an SID for an id.

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

    Shirish Pargaonkar
     
  • Define (global) data structures to store ids, uids and gids, to which a
    SID maps. There are two separate trees, one for SID/uid and another one
    for SID/gid.

    A new type of key, cifs_idmap_key_type, is used.

    Keys are instantiated and searched using credential of the root by
    overriding and restoring the credentials of the caller requesting the key.

    Id mapping functions are invoked under config option of cifs acl.

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

    Shirish Pargaonkar
     
  • Add this let us drop filemap_write_and_wait from cifs_invalidate_mapping
    and simplify the code to properly process invalidate logic.

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

    Pavel Shilovsky
     
  • As with Linux nfs client, which uses "nfsvers=" or "vers=" to
    indicate which protocol to use for mount, specifying

    "vers=smb2" or "vers=2"

    will force an smb2 mount. When vers is not specified cifs is used

    ie "vers=cifs" or "vers=1"

    We can eventually autonegotiate down from smb2 to cifs
    when smb2 is stable enough to make it the default, but this
    is for the future. At that time we could also implement a
    "maxprotocol" mount option as smbclient and Samba have today,
    but that would be premature until smb2 is stable.

    Intially the smb2 Kconfig option will depend on "BROKEN"
    until the merge is complete, and then be "EXPERIMENTAL"
    When it is no longer experimental we can consider changing
    the default protocol to attempt first.

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

    Steve French
     
  • Use invalidate_inode_pages2 that don't leave pages even if shrink_page_list()
    has a temp ref on them. It prevents a data coherency problem when
    cifs_invalidate_mapping didn't invalidate pages but the client thinks that a data
    from the cache is uptodate according to an oplock level (exclusive or II).

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

    Pavel Shilovsky
     
  • The comment about checking the bcc is in the wrong place. Also make it
    match kernel coding style.

    Reported-and-acked-by: David Howells
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • I originally intended to remove this warning in 2.6.34, but it's not in
    a high performance codepath and might help us to catch bugs later. Let's
    keep it, but fix the comment to allay confusion about its removal.

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

    Jeff Layton
     
  • Allow setting cifs_acl on the server.
    Pass on to the server the ACL blob generated by an application.
    cifs is just a pass-through, it does not monitor or inspect the contents
    of the blob, server decides whether to enforce/apply the ACL blob composed
    by an application.
    If setting of ACL is succeessful, mark the inode for revalidation.

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

    Steve French
     
  • local cifs functions (repost)

    Using kernel crypto APIs for DES encryption during LM and NT hash generation
    instead of local functions within cifs.
    Source file smbdes.c is deleted sans four functions, one of which
    uses ecb des functionality provided by kernel crypto APIs.

    Remove function SMBOWFencrypt.

    Add return codes to various functions such as calc_lanman_hash,
    SMBencrypt, and SMBNTencrypt. Includes fix noticed by Dan Carpenter.

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

    Steve French
     
  • Remove config flag CIFS_EXPERIMENTAL.
    Do export operations under new config flag CIFS_NFSD_EXPORT

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

    Shirish Pargaonkar
     
  • SMB2 is the followon to the CIFS (and SMB) protocols
    and the default for Windows since Windows Vista, and also
    now implemented by various non-Windows servers. SMB2
    is more secure, has various performance advantages, including
    larger i/o sizes, flow control, better caching model and more.
    SMB2 also resolves some scalability limits in the cifs
    protocol and adds many new features while being much
    simpler (only a few dozen commands instead of hundreds)
    and since the protocol is clearer it is
    also more consistently implemented across servers
    and thus easier to optimize.

    After much discussion with Jeff Layton, Jeremy Allison
    and others at Connectathon, we decided to move the smb2
    code from a distinct .ko and fstype into distinct
    C files that optionally build in cifs.ko. As a result
    the Kconfig gets simpler.

    To avoid destabilizing cifs, the smb2 code is going
    to be moved into its own experimental CONFIG_CIFS_SMB2 ifdef
    as it is merged and rereviewed. The changes to stable
    cifs (builds with the smb2 ifdef off) are expected to be
    fairly small.

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

    Steve French
     
  • We were reserving MAX_USERNAME (now 256) on stack for
    something which only needs to fit about 24 bytes ie
    string krb50x + printf version of uid

    Signed-off-by: Steve French

    Steve French
     
  • The patch below removes an extra "l" in the word.

    Signed-off-by: Justin P. Mattock
    Signed-off-by: Steve French

    Justin P. Mattock
     
  • Recent Windows versions now create symlinks more frequently
    and they do use this "reparse point" symlink mechanism. We can of course
    do symlinks nicely to Samba and other servers which support the
    CIFS Unix Extensions and we can also do SFU symlinks and "client only"
    "MF" symlinks optionally, but for recent Windows we currently can not
    handle the common "reparse point" symlinks fully, removing the caller
    for this. We will need to extend and reenable this "reparse point" worker
    code in cifs and fix cifs_symlink to call this. In the interim this code
    has been moved to its own config option so it is not compiled in by default
    until cifs_symlink fixed up (and tested) to use this.

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

    Steve French
     
  • The CIFSSMBNotify worker is unused, pending changes to allow it to be called
    via inotify, so move it into its own experimental config option so it does
    not get built in, until the necessary VFS support is fixed. It used to
    be used in dnotify, but according to Jeff, inotify needs minor changes
    before we can reenable this.

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

    Steve French
     
  • ino is unused in function cifs_root_iget().

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

    Shirish Pargaonkar
     
  • No functional changes requires that we eat errors from strtobool.
    If people want to not do this, then it should be fixed at a later date.

    V2: Simplification suggested by Rusty Russell removes the need for
    additional variable ret.

    Signed-off-by: Jonathan Cameron
    Signed-off-by: Rusty Russell

    Jonathan Cameron