17 Jan, 2015

2 commits


16 Jan, 2015

1 commit


13 Jan, 2015

1 commit

  • commit 0efaa7e82f02fe69c05ad28e905f31fc86e6f08e
    locks: generic_delete_lease doesn't need a file_lock at all

    moves the call to fl->fl_lmops->lm_change() to a place in the
    code where fl might be a non-lease lock.
    When that happens, fl_lmops is NULL and an Oops ensures.

    So add an extra test to restore correct functioning.

    Reported-by: Linda Walsh
    Link: https://bugzilla.suse.com/show_bug.cgi?id=912569
    Cc: stable@vger.kernel.org (v3.18)
    Fixes: 0efaa7e82f02fe69c05ad28e905f31fc86e6f08e
    Signed-off-by: NeilBrown
    Signed-off-by: Jeff Layton

    NeilBrown
     

12 Jan, 2015

1 commit

  • Pull scheduler fixes from Ingo Molnar:
    "Misc fixes: group scheduling corner case fix, two deadline scheduler
    fixes, effective_load() overflow fix, nested sleep fix, 6144 CPUs
    system fix"

    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched/fair: Fix RCU stall upon -ENOMEM in sched_create_group()
    sched/deadline: Avoid double-accounting in case of missed deadlines
    sched/deadline: Fix migration of SCHED_DEADLINE tasks
    sched: Fix odd values in effective_load() calculations
    sched, fanotify: Deal with nested sleeps
    sched: Fix KMALLOC_MAX_SIZE overflow during cpumask allocation

    Linus Torvalds
     

10 Jan, 2015

4 commits

  • Pull two nfsd bugfixes from Bruce Fields.

    * 'for-3.19' of git://linux-nfs.org/~bfields/linux:
    rpc: fix xdr_truncate_encode to handle buffer ending on page boundary
    nfsd: fix fi_delegees leak when fi_had_conflict returns true

    Linus Torvalds
     
  • Pull two Ceph fixes from Sage Weil:
    "These are both pretty trivial: a sparse warning fix and size_t printk
    thing"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
    libceph: fix sparse endianness warnings
    ceph: use %zu for len in ceph_fill_inline_data()

    Linus Torvalds
     
  • Pull btrfs fixes from Chris Mason:
    "None of these are huge, but my commit does fix a regression from 3.18
    that could cause lost files during log replay.

    This also adds Dave Sterba to the list of Btrfs maintainers. It
    doesn't mean we're doing things differently, but Dave has really been
    helping with the maintainer workload for years"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: don't delay inode ref updates during log replay
    Btrfs: correctly get tree level in tree_backref_for_extent
    Btrfs: call inode_dec_link_count() on mkdir error path
    Btrfs: abort transaction if we don't find the block group
    Btrfs, scrub: uninitialized variable in scrub_extent_for_parity()
    Btrfs: add more maintainers

    Linus Torvalds
     
  • Returning a difference from a comparison functions is usually wrong
    (see acbbe6fbb240 "kcmp: fix standard comparison bug" for the long
    story). Here there is the additional twist that if the void pointers
    ns and kn->ns happen to differ by a multiple of 2^32,
    kernfs_name_compare returns 0, falsely reporting a match to the
    caller.

    Technically 'hash - kn->hash' is ok since the hashes are restricted to
    31 bits, but it's better to avoid that subtlety.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Rasmus Villemoes
     

09 Jan, 2015

5 commits

  • As per e23738a7300a ("sched, inotify: Deal with nested sleeps").

    fanotify_read is a wait loop with sleeps in. Wait loops rely on
    task_struct::state and sleeps do too, since that's the only means of
    actually sleeping. Therefore the nested sleeps destroy the wait loop
    state and the wait loop breaks the sleep functions that assume
    TASK_RUNNING (mutex_lock).

    Fix this by using the new woken_wake_function and wait_woken() stuff,
    which registers wakeups in wait and thereby allows shrinking the
    task_state::state changes to the actual sleep part.

    Reported-by: Yuanhan Liu
    Reported-by: Sedat Dilek
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Takashi Iwai
    Cc: Al Viro
    Cc: Eric Paris
    Cc: Linus Torvalds
    Cc: Eric Paris
    Link: http://lkml.kernel.org/r/20141216152838.GZ3337@twins.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Fix clashing values for O_PATH and FMODE_NONOTIFY on sparc. The
    clashing O_PATH value was added in commit 5229645bdc35 ("vfs: add
    nonconflicting values for O_PATH") but this can't be changed as it is
    user-visible.

    FMODE_NONOTIFY is only used internally in the kernel, but it is in the
    same numbering space as the other O_* flags, as indicated by the comment
    at the top of include/uapi/asm-generic/fcntl.h (and its use in
    fs/notify/fanotify/fanotify_user.c). So renumber it to avoid the clash.

    All of this has happened before (commit 12ed2e36c98a: "fanotify:
    FMODE_NONOTIFY and __O_SYNC in sparc conflict"), and all of this will
    happen again -- so update the uniqueness check in fcntl_init() to
    include __FMODE_NONOTIFY.

    Signed-off-by: David Drysdale
    Acked-by: David S. Miller
    Acked-by: Jan Kara
    Cc: Heinrich Schuchardt
    Cc: Alexander Viro
    Cc: Arnd Bergmann
    Cc: Stephen Rothwell
    Cc: Eric Paris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Drysdale
     
  • In ocfs2_link(), the parent directory inode passed to function
    ocfs2_lookup_ino_from_name() is wrong. Parameter dir is the parent of
    new_dentry not old_dentry. We should get old_dir from old_dentry and
    lookup old_dentry in old_dir in case another node remove the old dentry.

    With this change, hard linking works again, when paths are relative with
    at least one subdirectory. This is how the problem was reproducable:

    # mkdir a
    # mkdir b
    # touch a/test
    # ln a/test b/test
    ln: failed to create hard link `b/test' => `a/test': No such file or directory

    However when creating links in the same dir, it worked well.

    Now the link gets created.

    Fixes: 0e048316ff57 ("ocfs2: check existence of old dentry in ocfs2_link()")
    Signed-off-by: joyce.xue
    Reported-by: Szabo Aron - UBIT
    Cc: Mark Fasheh
    Cc: Joel Becker
    Tested-by: Aron Szabo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xue jiufei
     
  • In dlm_process_recovery_data, only when dlm_new_lock failed the ret will
    be set to -ENOMEM. And in this case, newlock is definitely NULL. So
    test newlock is meaningless, remove it.

    Signed-off-by: Joseph Qi
    Reviewed-by: Alex Chen
    Reviewed-by: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joseph Qi
     
  • len is size_t, should be printed with %zu.

    Signed-off-by: Ilya Dryomov

    Ilya Dryomov
     

08 Jan, 2015

1 commit

  • Currently, nfs4_set_delegation takes a reference to an existing
    delegation and then checks to see if there is a conflict. If there is
    one, then it doesn't release that reference.

    Change the code to take the reference after the check and only if there
    is no conflict.

    Signed-off-by: Jeff Layton
    Cc: stable@vger.kernel.org
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     

07 Jan, 2015

1 commit


06 Jan, 2015

8 commits

  • Theoretically we need to order setting of various fields in fc with
    fc->initialized.

    No known bug reports related to this yet.

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • Analysis from Marc:

    "Commit 7078187a795f ("fuse: introduce fuse_simple_request() helper")
    from the above pull request triggers some EIO errors for me in some tests
    that rely on fuse

    Looking at the code changes and a bit of debugging info I think there's a
    general problem here that fuse_get_req checks and possibly waits for
    fc->initialized, and this was always called first. But this commit
    changes the ordering and in many places fc->minor is now possibly used
    before fuse_get_req, and we can't be sure that fc has been initialized.
    In my case fuse_lookup_init sets req->out.args[0].size to the wrong size
    because fc->minor at that point is still 0, leading to the EIO error."

    Fix by moving the compat adjustments into fuse_simple_request() to after
    fuse_get_req().

    This is also more readable than the original, since now compatibility is
    handled in a single function instead of cluttering each operation.

    Reported-by: Marc Dionne
    Tested-by: Marc Dionne
    Signed-off-by: Miklos Szeredi
    Fixes: 7078187a795f ("fuse: introduce fuse_simple_request() helper")

    Miklos Szeredi
     
  • Remove an incorrect check for NFS_DELEGATION_NEED_RECLAIM in
    can_open_delegated(). We are allowed to cache opens even in
    a situation where we're doing reboot recovery.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Detect server trunking across transport protocols. Otherwise, an
    RDMA mount and a TCP mount of the same server will end up with
    separate nfs_clients using the same clientid4.

    Reported-by: Dai Ngo
    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • While we normally expect the NFSv4 client to always send the same client
    owner to all servers, there are a couple of situations where that is not
    the case:
    1) In NFSv4.0, switching between use of '-omigration' and not will cause
    the kernel to switch between using the non-uniform and uniform client
    strings.
    2) In NFSv4.1, or NFSv4.0 when using uniform client strings, if the
    uniquifier string is suddenly changed.

    This patch will catch those situations by checking the client owner id
    in the trunking detection code, and will do the right thing if it notices
    that the strings differ.

    Cc: Chuck Lever
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Ensure that we cache the NFSv4/v4.1 client owner_id so that we can
    verify it when we're doing trunking detection.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Currently, our trunking code will check for session trunking, but will
    fail to detect client id trunking. This is a problem, because it means
    that the client will fail to recognise that the two connections represent
    shared state, even if they do not permit a shared session.
    By removing the check for the server minor id, and only checking the
    major id, we will end up doing the right thing in both cases: we close
    down the new nfs_client and fall back to using the existing one.

    Fixes: 05f4c350ee02e ("NFS: Discover NFSv4 server trunking when mounting")
    Cc: Chuck Lever
    Cc: stable@vger.kernel.org # 3.7.x
    Tested-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • This commit fixes a race whereby nlmclnt_init() first starts the lockd
    daemon, and then calls nlm_bind_host() with the expectation that
    nlmsvc_timeout has already been initialised. Unfortunately, there is no
    no synchronisation between lockd() and lockd_up() to guarantee that this
    is the case.

    Fix is to move the initialisation of nlmsvc_timeout into lockd_create_svc

    Fixes: 9a1b6bf818e74 ("LOCKD: Don't call utsname()->nodename...")
    Cc: Bruce Fields
    Cc: stable@vger.kernel.org # 3.10.x
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

03 Jan, 2015

7 commits

  • Signed-off-by: Jakub Wilk
    Signed-off-by: Theodore Ts'o

    Jakub Wilk
     
  • This reverts commit 14516bb7bb6ffbd49f35389f9ece3b2045ba5815.

    This was causing regression test failures with generic/285 with an ext3
    filesystem using CONFIG_EXT4_USE_FOR_EXT23.

    Signed-off-by: Theodore Ts'o

    Theodore Ts'o
     
  • Commit 1d52c78afbb (Btrfs: try not to ENOSPC on log replay) added a
    check to skip delayed inode updates during log replay because it
    confuses the enospc code. But the delayed processing will end up
    ignoring delayed refs from log replay because the inode itself wasn't
    put through the delayed code.

    This can end up triggering a warning at commit time:

    WARNING: CPU: 2 PID: 778 at fs/btrfs/delayed-inode.c:1410 btrfs_assert_delayed_root_empty+0x32/0x34()

    Which is repeated for each commit because we never process the delayed
    inode ref update.

    The fix used here is to change btrfs_delayed_delete_inode_ref to return
    an error if we're currently in log replay. The caller will do the ref
    deletion immediately and everything will work properly.

    Signed-off-by: Chris Mason
    cc: stable@vger.kernel.org # v3.18 and any stable series that picked 1d52c78afbbf80b58299e076a159617d6b42fe3c

    Chris Mason
     
  • If we are using skinny metadata, the block's tree level is in the offset
    of the key and not in a btrfs_tree_block_info structure following the
    extent item (it doesn't exist). Therefore fix it.

    Besides returning the correct level in the tree, this also prevents reading
    past the leaf's end in the case where the extent item is the last item in
    the leaf (eb) and it has only 1 inline reference - this is because
    sizeof(struct btrfs_tree_block_info) is greater than
    sizeof(struct btrfs_extent_inline_ref).

    Got it while running a scrub which produced the following warning:

    BTRFS: checksum error at logical 42123264 on dev /dev/sde, sector 15840: metadata node (level 24) in tree 5

    Signed-off-by: Filipe Manana
    Reviewed-by: Satoru Takeuchi
    Signed-off-by: Chris Mason

    Filipe Manana
     
  • In btrfs_mkdir(), if it fails to create dir, we should
    clean up existed items, setting inode's link properly
    to make sure it could be cleaned up properly.

    Signed-off-by: Wang Shilong
    Signed-off-by: Chris Mason

    Wang Shilong
     
  • We shouldn't BUG_ON() if there is corruption. I hit this while testing my block
    group patch and the abort worked properly. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • The only way that "ret" is set is when we call scrub_pages_for_parity()
    so the skip to "if (ret) " test doesn't make sense and causes a static
    checker warning.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Chris Mason

    Dan Carpenter
     

30 Dec, 2014

2 commits


27 Dec, 2014

1 commit

  • Prevent BUG or corrupted file systems after the following:

    mkfs.ext4 /dev/vdc 100M
    mount -t ext4 -o sb=40961 /dev/vdc /vdc
    resize2fs /dev/vdc

    We previously prevented online resizing using the old resize ioctl.
    Move the code to ext4_resize_begin(), so the check applies for all of
    the resize ioctl's.

    Reported-by: Maxim Malkov
    Signed-off-by: Theodore Ts'o

    Theodore Ts'o
     

23 Dec, 2014

1 commit

  • In spite of different file type,
    if file is same name and same inode number, old inode cache is used.
    This causes that you can not cd directory, can not cat SymbolicLink.
    So this patch is that if file type is different, return error.

    Reproducible sample :
    1. create file 'a' at cifs client.
    2. repeat rm and mkdir 'a' 4 times at server, then direcotry 'a' having same inode number is created.
    (Repeat 4 times, then same inode number is recycled.)
    (When server is under RHEL 6.6, 1 time is O.K. Always same inode number is recycled.)
    3. ls -li at client, then you can not cd directory, can not remove directory.

    SymbolicLink has same problem.

    Bug link:
    https://bugzilla.kernel.org/show_bug.cgi?id=90011

    Signed-off-by: Nakajima Akira
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Nakajima Akira
     

22 Dec, 2014

2 commits

  • Replace repeated dereferences like dir->i_sb by storing superblock
    pointer in a variable and using that.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Check that length specified in a component of a symlink fits in the
    input buffer we are reading. Also properly ignore component length for
    component types that do not use it. Otherwise we read memory after end
    of buffer for corrupted udf image.

    Reported-by: Carl Henrik Lunde
    CC: stable@vger.kernel.org
    Signed-off-by: Jan Kara

    Jan Kara
     

20 Dec, 2014

3 commits

  • Pull vfs pile #3 from Al Viro:
    "Assorted fixes and patches from the last cycle"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    [regression] chunk lost from bd9b51
    vfs: make mounts and mountstats honor root dir like mountinfo does
    vfs: cleanup show_mountinfo
    init: fix read-write root mount
    unfuck binfmt_misc.c (broken by commit e6084d4)
    vm_area_operations: kill ->migrate()
    new helper: iter_is_iovec()
    move_extent_per_page(): get rid of unused w_flags
    lustre: get rid of playing with ->fs
    btrfs: filp_open() returns ERR_PTR() on failure, not NULL...

    Linus Torvalds
     
  • …/git/tyhicks/ecryptfs

    Pull eCryptfs fixes from Tyler Hicks:
    "Fixes for filename decryption and encrypted view plus a cleanup

    - The filename decryption routines were, at times, writing a zero
    byte one character past the end of the filename buffer

    - The encrypted view feature attempted, and failed, to roll its own
    form of enforcing a read-only mount instead of letting the VFS
    enforce it"

    * tag 'ecryptfs-3.19-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
    eCryptfs: Remove buggy and unnecessary write in file name decode routine
    eCryptfs: Remove unnecessary casts when parsing packet lengths
    eCryptfs: Force RO mount when encrypted view is enabled

    Linus Torvalds
     
  • Pull more btrfs updates from Chris Mason:
    "This is part two of our merge window patches.

    These are all from Filipe, and fix some really hard to find races that
    can cause corruptions. Most of them involved block group removal
    (balance) or discard"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: remove non-sense btrfs_error_discard_extent() function
    Btrfs: fix fs corruption on transaction abort if device supports discard
    Btrfs: always clear a block group node when removing it from the tree
    Btrfs: ensure deletion from pinned_chunks list is protected

    Linus Torvalds