12 Mar, 2014

1 commit

  • Pull CIFS fixes from Steve French:
    "A fix for the problem which Al spotted in cifs_writev and a followup
    (noticed when fixing CVE-2014-0069) patch to ensure that cifs never
    sends more than the smb frame length over the socket (as we saw with
    that cifs_iovec_write problem that Jeff fixed last month)"

    * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
    cifs: mask off top byte in get_rfc1002_length()
    cifs: sanity check length of data to send before sending
    CIFS: Fix wrong pos argument of cifs_find_lock_conflict

    Linus Torvalds
     

11 Mar, 2014

4 commits

  • Merge misc fixes from Andrew Morton:
    "Nine fixes"

    * emailed patches from Andrew Morton akpm@linux-foundation.org>:
    cris: convert ffs from an object-like macro to a function-like macro
    hfsplus: add HFSX subfolder count support
    tools/testing/selftests/ipc/msgque.c: handle msgget failure return correctly
    MAINTAINERS: blackfin: add git repository
    revert "kallsyms: fix absolute addresses for kASLR"
    mm/Kconfig: fix URL for zsmalloc benchmark
    fs/proc/base.c: fix GPF in /proc/$PID/map_files
    mm/compaction: break out of loop on !PageBuddy in isolate_freepages_block
    mm: fix GFP_THISNODE callers and clarify

    Linus Torvalds
     
  • Adds support for HFSX 'HasFolderCount' flag and a corresponding
    'folderCount' field in folder records. (For reference see
    HFS_FOLDERCOUNT and kHFSHasFolderCountBit/kHFSHasFolderCountMask in
    Apple's source code.)

    Ignoring subfolder count leads to fs errors found by Mac:

    ...
    Checking catalog hierarchy.
    HasFolderCount flag needs to be set (id = 105)
    (It should be 0x10 instead of 0)
    Incorrect folder count in a directory (id = 2)
    (It should be 7 instead of 6)
    ...

    Steps to reproduce:
    Format with "newfs_hfs -s /dev/diskXXX".
    Mount in Linux.
    Create a new directory in root.
    Unmount.
    Run "fsck_hfs /dev/diskXXX".

    The patch handles directory creation, deletion, and rename.

    Signed-off-by: Sergei Antonov
    Reviewed-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sergei Antonov
     
  • The expected logic of proc_map_files_get_link() is either to return 0
    and initialize 'path' or return an error and leave 'path' uninitialized.

    By the time dname_to_vma_addr() returns 0 the corresponding vma may have
    already be gone. In this case the path is not initialized but the
    return value is still 0. This results in 'general protection fault'
    inside d_path().

    Steps to reproduce:

    CONFIG_CHECKPOINT_RESTORE=y

    fd = open(...);
    while (1) {
    mmap(fd, ...);
    munmap(fd, ...);
    }

    ls -la /proc/$PID/map_files

    Addresses https://bugzilla.kernel.org/show_bug.cgi?id=68991

    Signed-off-by: Artem Fetishev
    Signed-off-by: Aleksandr Terekhov
    Reported-by:
    Acked-by: Pavel Emelyanov
    Acked-by: Cyrill Gorcunov
    Reviewed-by: "Eric W. Biederman"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Artem Fetishev
     
  • Pull vfs fixes from Al Viro.

    Clean up file table accesses (get rid of fget_light() in favor of the
    fdget() interface), add proper file position locking.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    get rid of fget_light()
    sockfd_lookup_light(): switch to fdget^W^Waway from fget_light
    vfs: atomic f_pos accesses as per POSIX
    ocfs2 syncs the wrong range...

    Linus Torvalds
     

10 Mar, 2014

4 commits

  • instead of returning the flags by reference, we can just have the
    low-level primitive return those in lower bits of unsigned long,
    with struct file * derived from the rest.

    Signed-off-by: Al Viro

    Al Viro
     
  • Our write() system call has always been atomic in the sense that you get
    the expected thread-safe contiguous write, but we haven't actually
    guaranteed that concurrent writes are serialized wrt f_pos accesses, so
    threads (or processes) that share a file descriptor and use "write()"
    concurrently would quite likely overwrite each others data.

    This violates POSIX.1-2008/SUSv4 Section XSI 2.9.7 that says:

    "2.9.7 Thread Interactions with Regular File Operations

    All of the following functions shall be atomic with respect to each
    other in the effects specified in POSIX.1-2008 when they operate on
    regular files or symbolic links: [...]"

    and one of the effects is the file position update.

    This unprotected file position behavior is not new behavior, and nobody
    has ever cared. Until now. Yongzhi Pan reported unexpected behavior to
    Michael Kerrisk that was due to this.

    This resolves the issue with a f_pos-specific lock that is taken by
    read/write/lseek on file descriptors that may be shared across threads
    or processes.

    Reported-by: Yongzhi Pan
    Reported-by: Michael Kerrisk
    Cc: Al Viro
    Signed-off-by: Linus Torvalds
    Signed-off-by: Al Viro

    Linus Torvalds
     
  • Cc: stable@vger.kernel.org
    Signed-off-by: Al Viro

    Al Viro
     
  • Pull NFS client bugfixes from Trond Myklebust:
    "Highlights include:

    - Fix another nfs4_sequence corruptor in RELEASE_LOCKOWNER
    - Fix an Oopsable delegation callback race
    - Fix another bad stateid infinite loop
    - Fail the data server I/O is the stateid represents a lost lock
    - Fix an Oopsable sunrpc trace event"

    * tag 'nfs-for-3.14-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    SUNRPC: Fix oops when trace sunrpc_task events in nfs client
    NFSv4: Fail the truncate() if the lock/open stateid is invalid
    NFSv4.1 Fail data server I/O if stateid represents a lost lock
    NFSv4: Fix the return value of nfs4_select_rw_stateid
    NFSv4: nfs4_stateid_is_current should return 'true' for an invalid stateid
    NFS: Fix a delegation callback race
    NFSv4: Fix another nfs4_sequence corruptor

    Linus Torvalds
     

08 Mar, 2014

1 commit

  • Pull block fixes from Jens Axboe:
    "Small collection of fixes for 3.14-rc. It contains:

    - Three minor update to blk-mq from Christoph.

    - Reduce number of unaligned (< 4kb) in-flight writes on mtip32xx to
    two. From Micron.

    - Make the blk-mq CPU notify spinlock raw, since it can't be a
    sleeper spinlock on RT. From Mike Galbraith.

    - Drop now bogus BUG_ON() for bio iteration with blk integrity. From
    Nic Bellinger.

    - Properly propagate the SYNC flag on requests. From Shaohua"

    * 'for-linus' of git://git.kernel.dk/linux-block:
    blk-mq: add REQ_SYNC early
    rt,blk,mq: Make blk_mq_cpu_notify_lock a raw spinlock
    bio-integrity: Drop bio_integrity_verify BUG_ON in post bip->bip_iter world
    blk-mq: support partial I/O completions
    blk-mq: merge blk_mq_insert_request and blk_mq_run_request
    blk-mq: remove blk_mq_alloc_rq
    mtip32xx: Reduce the number of unaligned writes to 2

    Linus Torvalds
     

06 Mar, 2014

4 commits

  • If the open stateid could not be recovered, or the file locks were lost,
    then we should fail the truncate() operation altogether.

    Reported-by: Andy Adamson
    Link: http://lkml.kernel.org/r/1393954269-3974-1-git-send-email-andros@netapp.com
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Signed-off-by: Andy Adamson
    Link: http://lkml.kernel.org/r/1393954269-3974-1-git-send-email-andros@netapp.com
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • In commit 5521abfdcf4d6 (NFSv4: Resend the READ/WRITE RPC call
    if a stateid change causes an error), we overloaded the return value of
    nfs4_select_rw_stateid() to cause it to return -EWOULDBLOCK if an RPC
    call is outstanding that would cause the NFSv4 lock or open stateid
    to change.
    That is all redundant when we actually copy the stateid used in the
    read/write RPC call that failed, and check that against the current
    stateid. It is doubly so, when we consider that in the NFSv4.1 case,
    we also set the stateid's seqid to the special value '0', which means
    'match the current valid stateid'.

    Reported-by: Andy Adamson
    Link: http://lkml.kernel.org/r/1393954269-3974-1-git-send-email-andros@netapp.com
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • When nfs4_set_rw_stateid() can fails by returning EIO to indicate that
    the stateid is completely invalid, then it makes no sense to have it
    trigger a retry of the READ or WRITE operation. Instead, we should just
    have it fall through and attempt a recovery.

    This fixes an infinite loop in which the client keeps replaying the same
    bad stateid back to the server.

    Reported-by: Andy Adamson
    Link: http://lkml.kernel.org/r/1393954269-3974-1-git-send-email-andros@netapp.com
    Cc: stable@vger.kernel.org # 3.10+
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

04 Mar, 2014

3 commits

  • Current implementation of HFS+ driver has small issue with remount
    option. Namely, for example, you are unable to remount from RO mode
    into RW mode by means of command "mount -o remount,rw /dev/loop0
    /mnt/hfsplus". Trying to execute sequence of commands results in an
    error message:

    mount /dev/loop0 /mnt/hfsplus
    mount -o remount,ro /dev/loop0 /mnt/hfsplus
    mount -o remount,rw /dev/loop0 /mnt/hfsplus

    mount: you must specify the filesystem type

    mount -t hfsplus -o remount,rw /dev/loop0 /mnt/hfsplus

    mount: /mnt/hfsplus not mounted or bad option

    The reason of such issue is failure of mount syscall:

    mount("/dev/loop0", "/mnt/hfsplus", 0x2282a60, MS_MGC_VAL|MS_REMOUNT, NULL) = -1 EINVAL (Invalid argument)

    Namely, hfsplus_parse_options_remount() method receives empty "input"
    argument and return false in such case. As a result, hfsplus_remount()
    returns -EINVAL error code.

    This patch fixes the issue by means of return true for the case of empty
    "input" argument in hfsplus_parse_options_remount() method.

    Signed-off-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • Global quota files are accessed from different nodes. Thus we cannot
    cache offset of quota structure in the quota file after we drop our node
    reference count to it because after that moment quota structure may be
    freed and reallocated elsewhere by a different node resulting in
    corruption of quota file.

    Fix the problem by clearing dq_off when we are releasing dquot structure.
    We also remove the DB_READ_B handling because it is useless -
    DQ_ACTIVE_B is set iff DQ_READ_B is set.

    Signed-off-by: Jan Kara
    Cc: Goldwyn Rodrigues
    Cc: Joel Becker
    Reviewed-by: Mark Fasheh
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • Commit bf6bddf1924e ("mm: introduce compaction and migration for
    ballooned pages") introduces page_count(page) into memory compaction
    which dereferences page->first_page if PageTail(page).

    This results in a very rare NULL pointer dereference on the
    aforementioned page_count(page). Indeed, anything that does
    compound_head(), including page_count() is susceptible to racing with
    prep_compound_page() and seeing a NULL or dangling page->first_page
    pointer.

    This patch uses Andrea's implementation of compound_trans_head() that
    deals with such a race and makes it the default compound_head()
    implementation. This includes a read memory barrier that ensures that
    if PageTail(head) is true that we return a head page that is neither
    NULL nor dangling. The patch then adds a store memory barrier to
    prep_compound_page() to ensure page->first_page is set.

    This is the safest way to ensure we see the head page that we are
    expecting, PageTail(page) is already in the unlikely() path and the
    memory barriers are unfortunately required.

    Hugetlbfs is the exception, we don't enforce a store memory barrier
    during init since no race is possible.

    Signed-off-by: David Rientjes
    Cc: Holger Kiehl
    Cc: Christoph Lameter
    Cc: Rafael Aquini
    Cc: Vlastimil Babka
    Cc: Michal Hocko
    Cc: Mel Gorman
    Cc: Andrea Arcangeli
    Cc: Rik van Riel
    Cc: "Kirill A. Shutemov"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

03 Mar, 2014

2 commits


02 Mar, 2014

1 commit

  • nfs4_release_lockowner needs to set the rpc_message reply to point to
    the nfs4_sequence_res in order to avoid another Oopsable situation
    in nfs41_assign_slot.

    Fixes: fbd4bfd1d9d21 (NFS: Add nfs4_sequence calls for RELEASE_LOCKOWNER)
    Cc: stable@vger.kernel.org # 3.12+
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

01 Mar, 2014

1 commit

  • The rfc1002 length actually includes a type byte, which we aren't
    masking off. In most cases, it's not a problem since the
    RFC1002_SESSION_MESSAGE type is 0, but when doing a RFC1002 session
    establishment, the type is non-zero and that throws off the returned
    length.

    Signed-off-by: Jeff Layton
    Tested-by: Sachin Prabhu
    Signed-off-by: Steve French

    Jeff Layton
     

28 Feb, 2014

1 commit

  • Pull filesystem fixes from Jan Kara:
    "Notification, writeback, udf, quota fixes

    The notification patches are (with one exception) a fallout of my
    fsnotify rework which went into -rc1 (I've extented LTP to cover these
    cornercases to avoid similar breakage in future).

    The UDF patch is a nasty data corruption Al has recently reported,
    the revert of the writeback patch is due to possibility of violating
    sync(2) guarantees, and a quota bug can lead to corruption of quota
    files in ocfs2"

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    fsnotify: Allocate overflow events with proper type
    fanotify: Handle overflow in case of permission events
    fsnotify: Fix detection whether overflow event is queued
    Revert "writeback: do not sync data dirtied after sync start"
    quota: Fix race between dqput() and dquot_scan_active()
    udf: Fix data corruption on file type conversion
    inotify: Fix reporting of cookies for inotify events

    Linus Torvalds
     

25 Feb, 2014

4 commits

  • As mount() and kill_sb() is not a one-to-one match, we shoudn't get
    ns refcnt unconditionally in sysfs_mount(), and instead we should
    get the refcnt only when kernfs_mount() allocated a new superblock.

    v2:
    - Changed the name of the new argument, suggested by Tejun.
    - Made the argument optional, suggested by Tejun.

    v3:
    - Make the new argument as second-to-last arg, suggested by Tejun.

    Signed-off-by: Li Zefan
    Acked-by: Tejun Heo
    ---
    fs/kernfs/mount.c | 8 +++++++-
    fs/sysfs/mount.c | 5 +++--
    include/linux/kernfs.h | 9 +++++----
    3 files changed, 15 insertions(+), 7 deletions(-)
    Signed-off-by: Greg Kroah-Hartman

    Li Zefan
     
  • Commit 7053aee26a35 "fsnotify: do not share events between notification
    groups" used overflow event statically allocated in a group with the
    size of the generic notification event. This causes problems because
    some code looks at type specific parts of event structure and gets
    confused by a random data it sees there and causes crashes.

    Fix the problem by allocating overflow event with type corresponding to
    the group type so code cannot get confused.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • If the event queue overflows when we are handling permission event, we
    will never get response from userspace. So we must avoid waiting for it.
    Change fsnotify_add_notify_event() to return whether overflow has
    happened so that we can detect it in fanotify_handle_event() and act
    accordingly.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Currently we didn't initialize event's list head when we removed it from
    the event list. Thus a detection whether overflow event is already
    queued wasn't working. Fix it by always initializing the list head when
    deleting event from a list.

    Signed-off-by: Jan Kara

    Jan Kara
     

24 Feb, 2014

2 commits

  • We had a bug discovered recently where an upper layer function
    (cifs_iovec_write) could pass down a smb_rqst with an invalid amount of
    data in it. The length of the SMB frame would be correct, but the rqst
    struct would cause smb_send_rqst to send nearly 4GB of data.

    This should never be the case. Add some sanity checking to the beginning
    of smb_send_rqst that ensures that the amount of data we're going to
    send agrees with the length in the RFC1002 header. If it doesn't, WARN()
    and return -EIO to the upper layers.

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

    Jeff Layton
     
  • and use generic_file_aio_write rather than __generic_file_aio_write
    in cifs_writev.

    Signed-off-by: Pavel Shilovsky
    Reported-by: Al Viro
    Signed-off-by: Steve French

    Pavel Shilovsky
     

23 Feb, 2014

1 commit

  • Pull xfs fixes from Dave Chinner:
    "This is the first pull request I've had to do for you, so I'm still
    sorting things out. The reason I'm sending this and not Ben should be
    obvious from the first commit below - SGI has stepped down from the
    XFS maintainership role. As such, I'd like to take another
    opportunity to thank them for their many years of effort maintaining
    XFS and supporting the XFS community that they developed from the
    ground up.

    So I haven't had time to work things like signed tags into my
    workflows yet, so this is just a repo branch I'm asking you to pull
    from. And yes, I named the branch -rc4 because I wanted the fixes in
    rc4, not because the branch was for merging into -rc3. Probably not
    right, either.

    Anyway, I should have everything sorted out by the time the next merge
    window comes around. If there's anything that you don't like in the
    pull req, feel free to flame me unmercifully.

    The changes are fixes for recent regressions and important thinkos in
    verification code:

    - a log vector buffer alignment issue on ia32
    - timestamps on truncate got mangled
    - primary superblock CRC validation fixes and error message
    sanitisation"

    * 'xfs-fixes-for-3.14-rc4' of git://oss.sgi.com/xfs/xfs:
    xfs: limit superblock corruption errors to actual corruption
    xfs: skip verification on initial "guess" superblock read
    MAINTAINERS: SGI no longer maintaining XFS
    xfs: xfs_sb_read_verify() doesn't flag bad crcs on primary sb
    xfs: ensure correct log item buffer alignment
    xfs: ensure correct timestamp updates from truncate

    Linus Torvalds
     

22 Feb, 2014

2 commits

  • This reverts commit c4a391b53a72d2df4ee97f96f78c1d5971b47489. Dave
    Chinner has reported the commit may cause some
    inodes to be left out from sync(2). This is because we can call
    redirty_tail() for some inode (which sets i_dirtied_when to current time)
    after sync(2) has started or similarly requeue_inode() can set
    i_dirtied_when to current time if writeback had to skip some pages. The
    real problem is in the functions clobbering i_dirtied_when but fixing
    that isn't trivial so revert is a safer choice for now.

    CC: stable@vger.kernel.org # >= 3.13
    Signed-off-by: Jan Kara

    Jan Kara
     
  • Given that bip->bip_iter.bi_size is decremented after bio_advance() ->
    bio_integrity_advance() is called, the BUG_ON() in bio_integrity_verify()
    ends up tripping in v3.14-rc1 code with the advent of immutable biovecs
    in:

    commit d57a5f7c6605f15f3b5134837e68b448a7cea88e
    Author: Kent Overstreet
    Date: Sat Nov 23 17:20:16 2013 -0800

    bio-integrity: Convert to bvec_iter

    Given that there is no easy way to ascertain the original bi_size
    value, go ahead and drop this BUG_ON().

    Reported-by: Sagi Grimberg
    Reported-by: Akinobu Mita
    Acked-by: Martin K. Petersen
    Cc: Kent Overstreet
    Signed-off-by: Nicholas Bellinger
    Signed-off-by: Jens Axboe

    Nicholas Bellinger
     

21 Feb, 2014

3 commits

  • Currently last dqput() can race with dquot_scan_active() causing it to
    call callback for an already deactivated dquot. The race is as follows:

    CPU1 CPU2
    dqput()
    spin_lock(&dq_list_lock);
    if (atomic_read(&dquot->dq_count) > 1) {
    - not taken
    if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {
    spin_unlock(&dq_list_lock);
    ->release_dquot(dquot);
    if (atomic_read(&dquot->dq_count) > 1)
    - not taken
    dquot_scan_active()
    spin_lock(&dq_list_lock);
    if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags))
    - not taken
    atomic_inc(&dquot->dq_count);
    spin_unlock(&dq_list_lock);
    - proceeds to release dquot
    ret = fn(dquot, priv);
    - called for inactive dquot

    Fix the problem by making sure possible ->release_dquot() is finished by
    the time we call the callback and new calls to it will notice reference
    dquot_scan_active() has taken and bail out.

    CC: stable@vger.kernel.org # >= 2.6.29
    Signed-off-by: Jan Kara

    Jan Kara
     
  • UDF has two types of files - files with data stored in inode (ICB in
    UDF terminology) and files with data stored in external data blocks. We
    convert file from in-inode format to external format in
    udf_file_aio_write() when we find out data won't fit into inode any
    longer. However the following race between two O_APPEND writes can happen:

    CPU1 CPU2
    udf_file_aio_write() udf_file_aio_write()
    down_write(&iinfo->i_data_sem);
    checks that i_size + count1 fits within inode
    => no need to convert
    up_write(&iinfo->i_data_sem);
    down_write(&iinfo->i_data_sem);
    checks that i_size + count2 fits
    within inode => no need to convert
    up_write(&iinfo->i_data_sem);
    generic_file_aio_write()
    - extends file by count1 bytes
    generic_file_aio_write()
    - extends file by count2 bytes

    Clearly if count1 + count2 doesn't fit into the inode, we overwrite
    kernel buffers beyond inode, possibly corrupting the filesystem as well.

    Fix the problem by acquiring i_mutex before checking whether write fits
    into the inode and using __generic_file_aio_write() afterwards which
    puts check and write into one critical section.

    Reported-by: Al Viro
    Signed-off-by: Jan Kara

    Jan Kara
     
  • Pull cgroup fixes from Tejun Heo:
    "Quite a few fixes this time.

    Three locking fixes, all marked for -stable. A couple error path
    fixes and some misc fixes. Hugh found a bug in memcg offlining
    sequence and we thought we could fix that from cgroup core side but
    that turned out to be insufficient and got reverted. A different fix
    has been applied to -mm"

    * 'for-3.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
    cgroup: update cgroup_enable_task_cg_lists() to grab siglock
    Revert "cgroup: use an ordered workqueue for cgroup destruction"
    cgroup: protect modifications to cgroup_idr with cgroup_mutex
    cgroup: fix locking in cgroup_cfts_commit()
    cgroup: fix error return from cgroup_create()
    cgroup: fix error return value in cgroup_mount()
    cgroup: use an ordered workqueue for cgroup destruction
    nfs: include xattr.h from fs/nfs/nfs3proc.c
    cpuset: update MAINTAINERS entry
    arm, pm, vmpressure: add missing slab.h includes

    Linus Torvalds
     

20 Feb, 2014

1 commit

  • Pull NFS client bugfixes from Trond Myklebust:
    "Highlights include stable fixes for the following bugs:

    - General performance regression due to NFS_INO_INVALID_LABEL being
    set when the server doesn't support labeled NFS
    - Hang in the RPC code due to a socket out-of-buffer race
    - Infinite loop when trying to establish the NFSv4 lease
    - Use-after-free bug in the RPCSEC gss code.
    - nfs4_select_rw_stateid is returning with a non-zero error value on
    success

    Other bug fixes:

    - Potential memory scribble in the RPC bi-directional RPC code
    - Pipe version reference leak
    - Use the correct net namespace in the new NFSv4 migration code"

    * tag 'nfs-for-3.14-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    NFS fix error return in nfs4_select_rw_stateid
    NFSv4: Use the correct net namespace in nfs4_update_server
    SUNRPC: Fix a pipe_version reference leak
    SUNRPC: Ensure that gss_auth isn't freed before its upcall messages
    SUNRPC: Fix potential memory scribble in xprt_free_bc_request()
    SUNRPC: Fix races in xs_nospace()
    SUNRPC: Don't create a gss auth cache unless rpc.gssd is running
    NFS: Do not set NFS_INO_INVALID_LABEL unless server supports labeled NFS

    Linus Torvalds
     

19 Feb, 2014

5 commits

  • Do not return an error when nfs4_copy_delegation_stateid succeeds.

    Signed-off-by: Andy Adamson
    Link: http://lkml.kernel.org/r/1392737765-41942-1-git-send-email-andros@netapp.com
    Fixes: ef1820f9be27b (NFSv4: Don't try to recover NFSv4 locks when...)
    Cc: NeilBrown
    Cc: stable@vger.kernel.org # 3.12+
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • Today, if

    xfs_sb_read_verify
    xfs_sb_verify
    xfs_mount_validate_sb

    detects superblock corruption, it'll be extremely noisy, dumping
    2 stacks, 2 hexdumps, etc.

    This is because we call XFS_CORRUPTION_ERROR in xfs_mount_validate_sb
    as well as in xfs_sb_read_verify.

    Also, *any* errors in xfs_mount_validate_sb which are not corruption
    per se; things like too-big-blocksize, bad version, bad magic, v1 dirs,
    rw-incompat etc - things which do not return EFSCORRUPTED - will
    still do the whole XFS_CORRUPTION_ERROR spew when xfs_sb_read_verify
    sees any error at all. And it suggests to the user that they
    should run xfs_repair, even if the root cause of the mount failure
    is a simple incompatibility.

    I'll submit that the probably-not-corrupted errors don't warrant
    this much noise, so this patch removes the warning for anything
    other than EFSCORRUPTED returns, and replaces the lower-level
    XFS_CORRUPTION_ERROR with an xfs_notice().

    Signed-off-by: Eric Sandeen
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Eric Sandeen
     
  • When xfs_readsb() does the very first read of the superblock,
    it makes a guess at the length of the buffer, based on the
    sector size of the underlying storage. This may or may
    not match the filesystem sector size in sb_sectsize, so
    we can't i.e. do a CRC check on it; it might be too short.

    In fact, mounting a filesystem with sb_sectsize larger
    than the device sector size will cause a mount failure
    if CRCs are enabled, because we are checksumming a length
    which exceeds the buffer passed to it.

    So always read twice; the first time we read with NULL
    buffer ops to skip verification; then set the proper
    read length, hook up the proper verifier, and give it
    another go.

    Once we are sure that we've got the right buffer length,
    we can also use bp->b_length in the xfs_sb_read_verify,
    rather than the less-trusted on-disk sectorsize for
    secondary superblocks. Before this we ran the risk of
    passing junk to the crc32c routines, which didn't always
    handle extreme values.

    Signed-off-by: Eric Sandeen
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Eric Sandeen
     
  • My earlier commit 10e6e65 deserves a layer or two of brown paper
    bags. The logic in that commit means that a CRC failure on the
    primary superblock will *never* result in an error return.

    Hopefully this fixes it, so that we always return the error
    if it's a primary superblock, otherwise only if the filesystem
    has CRCs enabled.

    Signed-off-by: Eric Sandeen
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    Eric Sandeen
     
  • Pull jfs fix from David Kleikamp:
    "Another ACL regression. This one more subtle"

    * tag 'jfs-3.14-rc4' of git://github.com/kleikamp/linux-shaggy:
    jfs: set i_ctime when setting ACL

    Linus Torvalds