09 Dec, 2011

4 commits

  • Prior to commit eaf35b1, cifs_save_resume_key had some NULL pointer
    checks at the top. It turns out that at least one of those NULL
    pointer checks is needed after all.

    When the LastNameOffset in a FIND reply appears to be beyond the end of
    the buffer, CIFSFindFirst and CIFSFindNext will set srch_inf.last_entry
    to NULL. Since eaf35b1, the code will now oops in this situation.

    Fix this by having the callers check for a NULL last entry pointer
    before calling cifs_save_resume_key. No change is needed for the
    call site in cifs_readdir as it's not reachable with a NULL
    current_entry pointer.

    This should fix:

    https://bugzilla.redhat.com/show_bug.cgi?id=750247

    Cc: stable@vger.kernel.org
    Cc: Christoph Hellwig
    Reported-by: Adam G. Metzler
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • In the recent overhaul of the demultiplex thread receive path, I
    neglected to ensure that we attempt to freeze on each pass through the
    receive loop.

    Reported-and-Tested-by: Woody Suwalski
    Reported-and-Tested-by: Adam Williamson
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • Fix sparse endian check warning while calling cifs_strtoUCS

    CHECK fs/cifs/smbencrypt.c
    fs/cifs/smbencrypt.c:216:37: warning: incorrect type in argument 1
    (different base types)
    fs/cifs/smbencrypt.c:216:37: expected restricted __le16 [usertype] *
    fs/cifs/smbencrypt.c:216:37: got unsigned short *

    Signed-off-by: Steve French
    Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com

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

    Pavel Shilovsky
     

08 Nov, 2011

1 commit


07 Nov, 2011

1 commit

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     

04 Nov, 2011

3 commits


02 Nov, 2011

2 commits


01 Nov, 2011

1 commit

  • Some files were using the complete module.h infrastructure without
    actually including the header at all. Fix them up in advance so
    once the implicit presence is removed, we won't get failures like this:

    CC [M] fs/nfsd/nfssvc.o
    fs/nfsd/nfssvc.c: In function 'nfsd_create_serv':
    fs/nfsd/nfssvc.c:335: error: 'THIS_MODULE' undeclared (first use in this function)
    fs/nfsd/nfssvc.c:335: error: (Each undeclared identifier is reported only once
    fs/nfsd/nfssvc.c:335: error: for each function it appears in.)
    fs/nfsd/nfssvc.c: In function 'nfsd':
    fs/nfsd/nfssvc.c:555: error: implicit declaration of function 'module_put_and_exit'
    make[3]: *** [fs/nfsd/nfssvc.o] Error 1

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

30 Oct, 2011

2 commits

  • Re-posting a patch originally posted by Oskar Liljeblad after
    rebasing on 3.2.

    Modify cifs to assume that the supplied password is encoded according
    to iocharset. Before this patch passwords would be treated as
    raw 8-bit data, which made authentication with Unicode passwords impossible
    (at least passwords with characters > 0xFF).

    The previous code would as a side effect accept passwords encoded with
    ISO 8859-1, since Unicode < 0x100 basically is ISO 8859-1. Software which
    relies on that will no longer support password chars > 0x7F unless it also
    uses iocharset=iso8859-1. (mount.cifs does not care about the encoding so
    it will work as expected.)

    Signed-off-by: Oskar Liljeblad
    Signed-off-by: Shirish Pargaonkar
    Reviewed-by: Pavel Shilovsky
    Tested-by: A
    Signed-off-by: Steve French

    Shirish Pargaonkar
     
  • Request to the cache in FL_POSIX case only.

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

    Pavel Shilovsky
     

29 Oct, 2011

4 commits

  • Update cifs version to 1.76 now that async read,
    lock caching, and changes to oplock enabled interface
    are in.

    Thanks to Pavel for reminding me.

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

    Steve French
     
  • to prevent the mutex being unlocked twice if we interrupt a blocked lock.

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

    Pavel Shilovsky
     
  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue: (21 commits)
    leases: fix write-open/read-lease race
    nfs: drop unnecessary locking in llseek
    ext4: replace cut'n'pasted llseek code with generic_file_llseek_size
    vfs: add generic_file_llseek_size
    vfs: do (nearly) lockless generic_file_llseek
    direct-io: merge direct_io_walker into __blockdev_direct_IO
    direct-io: inline the complete submission path
    direct-io: separate map_bh from dio
    direct-io: use a slab cache for struct dio
    direct-io: rearrange fields in dio/dio_submit to avoid holes
    direct-io: fix a wrong comment
    direct-io: separate fields only used in the submission path from struct dio
    vfs: fix spinning prevention in prune_icache_sb
    vfs: add a comment to inode_permission()
    vfs: pass all mask flags check_acl and posix_acl_permission
    vfs: add hex format for MAY_* flag values
    vfs: indicate that the permission functions take all the MAY_* flags
    compat: sync compat_stats with statfs.
    vfs: add "device" tag to /proc/self/mountstats
    cleanup: vfs: small comment fix for block_invalidatepage
    ...

    Fix up trivial conflict in fs/gfs2/file.c (llseek changes)

    Linus Torvalds
     
  • * '3.2-without-smb2' of git://git.samba.org/sfrench/cifs-2.6: (52 commits)
    Fix build break when freezer not configured
    Add definition for share encryption
    CIFS: Make cifs_push_locks send as many locks at once as possible
    CIFS: Send as many mandatory unlock ranges at once as possible
    CIFS: Implement caching mechanism for posix brlocks
    CIFS: Implement caching mechanism for mandatory brlocks
    CIFS: Fix DFS handling in cifs_get_file_info
    CIFS: Fix error handling in cifs_readv_complete
    [CIFS] Fixup trivial checkpatch warning
    [CIFS] Show nostrictsync and noperm mount options in /proc/mounts
    cifs, freezer: add wait_event_freezekillable and have cifs use it
    cifs: allow cifs_max_pending to be readable under /sys/module/cifs/parameters
    cifs: tune bdi.ra_pages in accordance with the rsize
    cifs: allow for larger rsize= options and change defaults
    cifs: convert cifs_readpages to use async reads
    cifs: add cifs_async_readv
    cifs: fix protocol definition for READ_RSP
    cifs: add a callback function to receive the rest of the frame
    cifs: break out 3rd receive phase into separate function
    cifs: find mid earlier in receive codepath
    ...

    Linus Torvalds
     

28 Oct, 2011

2 commits

  • The i_mutex lock use of generic _file_llseek hurts. Independent processes
    accessing the same file synchronize over a single lock, even though
    they have no need for synchronization at all.

    Under high utilization this can cause llseek to scale very poorly on larger
    systems.

    This patch does some rethinking of the llseek locking model:

    First the 64bit f_pos is not necessarily atomic without locks
    on 32bit systems. This can already cause races with read() today.
    This was discussed on linux-kernel in the past and deemed acceptable.
    The patch does not change that.

    Let's look at the different seek variants:

    SEEK_SET: Doesn't really need any locking.
    If there's a race one writer wins, the other loses.

    For 32bit the non atomic update races against read()
    stay the same. Without a lock they can also happen
    against write() now. The read() race was deemed
    acceptable in past discussions, and I think if it's
    ok for read it's ok for write too.

    => Don't need a lock.

    SEEK_END: This behaves like SEEK_SET plus it reads
    the maximum size too. Reading the maximum size would have the
    32bit atomic problem. But luckily we already have a way to read
    the maximum size without locking (i_size_read), so we
    can just use that instead.

    Without i_mutex there is no synchronization with write() anymore,
    however since the write() update is atomic on 64bit it just behaves
    like another racy SEEK_SET. On non atomic 32bit it's the same
    as SEEK_SET.

    => Don't need a lock, but need to use i_size_read()

    SEEK_CUR: This has a read-modify-write race window
    on the same file. One could argue that any application
    doing unsynchronized seeks on the same file is already broken.
    But for the sake of not adding a regression here I'm
    using the file->f_lock to synchronize this. Using this
    lock is much better than the inode mutex because it doesn't
    synchronize between processes.

    => So still need a lock, but can use a f_lock.

    This patch implements this new scheme in generic_file_llseek.
    I dropped generic_file_llseek_unlocked and changed all callers.

    Signed-off-by: Andi Kleen
    Signed-off-by: Christoph Hellwig

    Andi Kleen
     
  • Samba supports a setfs info level to negotiate encrypted
    shares. This patch adds the defines so we recognize
    this info level. Later patches will add the enablement
    for it.

    Acked-by: Jeremy Allison
    Signed-off-by: Steve French

    Steve French
     

25 Oct, 2011

6 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (59 commits)
    MAINTAINERS: linux-m32r is moderated for non-subscribers
    linux@lists.openrisc.net is moderated for non-subscribers
    Drop default from "DM365 codec select" choice
    parisc: Kconfig: cleanup Kernel page size default
    Kconfig: remove redundant CONFIG_ prefix on two symbols
    cris: remove arch/cris/arch-v32/lib/nand_init.S
    microblaze: add missing CONFIG_ prefixes
    h8300: drop puzzling Kconfig dependencies
    MAINTAINERS: microblaze-uclinux@itee.uq.edu.au is moderated for non-subscribers
    tty: drop superfluous dependency in Kconfig
    ARM: mxc: fix Kconfig typo 'i.MX51'
    Fix file references in Kconfig files
    aic7xxx: fix Kconfig references to READMEs
    Fix file references in drivers/ide/
    thinkpad_acpi: Fix printk typo 'bluestooth'
    bcmring: drop commented out line in Kconfig
    btmrvl_sdio: fix typo 'btmrvl_sdio_sd6888'
    doc: raw1394: Trivial typo fix
    CIFS: Don't free volume_info->UNC until we are entirely done with it.
    treewide: Correct spelling of successfully in comments
    ...

    Linus Torvalds
     
  • * 'next' of git://selinuxproject.org/~jmorris/linux-security: (95 commits)
    TOMOYO: Fix incomplete read after seek.
    Smack: allow to access /smack/access as normal user
    TOMOYO: Fix unused kernel config option.
    Smack: fix: invalid length set for the result of /smack/access
    Smack: compilation fix
    Smack: fix for /smack/access output, use string instead of byte
    Smack: domain transition protections (v3)
    Smack: Provide information for UDS getsockopt(SO_PEERCRED)
    Smack: Clean up comments
    Smack: Repair processing of fcntl
    Smack: Rule list lookup performance
    Smack: check permissions from user space (v2)
    TOMOYO: Fix quota and garbage collector.
    TOMOYO: Remove redundant tasklist_lock.
    TOMOYO: Fix domain transition failure warning.
    TOMOYO: Remove tomoyo_policy_memory_lock spinlock.
    TOMOYO: Simplify garbage collector.
    TOMOYO: Fix make namespacecheck warnings.
    target: check hex2bin result
    encrypted-keys: check hex2bin result
    ...

    Linus Torvalds
     
  • that reduces a traffic and increases a performance.

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

    Pavel Shilovsky
     
  • that reduces a traffic and increases a performance.

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

    Pavel Shilovsky
     
  • to handle all lock requests on the client in an exclusive oplock case.

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

    Pavel Shilovsky
     
  • If we have an oplock and negotiate mandatory locking style we handle
    all brlock requests on the client.

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

    Pavel Shilovsky
     

23 Oct, 2011

1 commit


21 Oct, 2011

1 commit


20 Oct, 2011

12 commits

  • Steve French
     
  • Add support to print nostrictsync and noperm mount options in
    /proc/mounts for shares mounted with these options.
    (cleanup merge conflict in Sachin's original patch)

    Suggested-by: Sachin Prabhu
    Signed-off-by: Steve French

    Steve French
     
  • CIFS currently uses wait_event_killable to put tasks to sleep while
    they await replies from the server. That function though does not
    allow the freezer to run. In many cases, the network interface may
    be going down anyway, in which case the reply will never come. The
    client then ends up blocking the computer from suspending.

    Fix this by adding a new wait_event_freezable variant --
    wait_event_freezekillable. The idea is to combine the behavior of
    wait_event_killable and wait_event_freezable -- put the task to
    sleep and only allow it to be awoken by fatal signals, but also
    allow the freezer to do its job.

    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Tune bdi.ra_pages to be a multiple of the rsize. This prevents the VFS
    from asking for pages that require small reads to satisfy.

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

    Jeff Layton
     
  • 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
     
  • ...which will allow cifs to do an asynchronous read call to the server.
    The caller will allocate and set up cifs_readdata for each READ_AND_X
    call that should be issued on the wire. The pages passed in are added
    to the pagecache, but not placed on the LRU list yet (as we need the
    page->lru to keep the pages on the list in the readdata).

    When cifsd identifies the mid, it will see that there is a special
    receive handler for the call, and use that to receive the rest of the
    frame. cifs_readv_receive will then marshal up a kvec array with
    kmapped pages from the pagecache, which eliminates one copy of the
    data. Once the data is received, the pages are added to the LRU list,
    set uptodate, and unlocked.

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

    Jeff Layton
     
  • There is no pad, and it simplifies the code to remove the "Data" field.

    None of the existing code relies on these fields, or on the READ_RSP
    being a particular length.

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

    Jeff Layton
     
  • In order to handle larger SMBs for readpages and other calls, we want
    to be able to read into a preallocated set of buffers. Rather than
    changing all of the existing code to preallocate buffers however, we
    instead add a receive callback function to the MID.

    cifsd will call this function once the mid_q_entry has been identified
    in order to receive the rest of the SMB. If the mid can't be identified
    or the receive pointer is unset, then the standard 3rd phase receive
    function will be called.

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

    Jeff Layton
     
  • Move the entire 3rd phase of the receive codepath into a separate
    function in preparation for the addition of a pluggable receive
    function.

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

    Jeff Layton
     
  • In order to receive directly into a preallocated buffer, we need to ID
    the mid earlier, before the bulk of the response is read. Call the mid
    finding routine as soon as we're able to read the mid.

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

    Jeff Layton