19 Jul, 2012

1 commit

  • Pull CIFS fixes from Steve French.

    * git://git.samba.org/sfrench/cifs-2.6:
    cifs: always update the inode cache with the results from a FIND_*
    cifs: when CONFIG_HIGHMEM is set, serialize the read/write kmaps
    cifs: on CONFIG_HIGHMEM machines, limit the rsize/wsize to the kmap space
    Initialise mid_q_entry before putting it on the pending queue

    Linus Torvalds
     

18 Jul, 2012

3 commits

  • Caused, AFAICS, by mismerge in commit ff9cb1c4eead ("Merge branch
    'for_linus' into for_linus_merged")

    Signed-off-by: Al Viro
    Cc: Theodore Ts'o
    Cc: stable@vger.kernel.org # 3.3+
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Pull a last-minute PM update from Rafael J. Wysocki:
    "This renames CAP_EPOLLWAKEUP to CAP_BLOCK_SUSPEND to encourage future
    reuse of the capability in question in related cases."

    * tag 'pm-post-3.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PM: Rename CAP_EPOLLWAKEUP to CAP_BLOCK_SUSPEND

    Linus Torvalds
     
  • As discussed in
    http://thread.gmane.org/gmane.linux.kernel/1249726/focus=1288990,
    the capability introduced in 4d7e30d98939a0340022ccd49325a3d70f7e0238
    to govern EPOLLWAKEUP seems misnamed: this capability is about governing
    the ability to suspend the system, not using a particular API flag
    (EPOLLWAKEUP). We should make the name of the capability more general
    to encourage reuse in related cases. (Whether or not this capability
    should also be used to govern the use of /sys/power/wake_lock is a
    question that needs to be separately resolved.)

    This patch renames the capability to CAP_BLOCK_SUSPEND. In order to ensure
    that the old capability name doesn't make it out into the wild, could you
    please apply and push up the tree to ensure that it is incorporated
    for the 3.5 release.

    Signed-off-by: Michael Kerrisk
    Acked-by: Serge Hallyn
    Signed-off-by: Rafael J. Wysocki

    Michael Kerrisk
     

17 Jul, 2012

5 commits

  • When we get back a FIND_FIRST/NEXT result, we have some info about the
    dentry that we use to instantiate a new inode. We were ignoring and
    discarding that info when we had an existing dentry in the cache.

    Fix this by updating the inode in place when we find an existing dentry
    and the uniqueid is the same.

    Cc: # .31.x
    Reported-and-Tested-by: Andrew Bartlett
    Reported-by: Bill Robertson
    Reported-by: Dion Edwards
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • Jian found that when he ran fsx on a 32 bit arch with a large wsize the
    process and one of the bdi writeback kthreads would sometimes deadlock
    with a stack trace like this:

    crash> bt
    PID: 2789 TASK: f02edaa0 CPU: 3 COMMAND: "fsx"
    #0 [eed63cbc] schedule at c083c5b3
    #1 [eed63d80] kmap_high at c0500ec8
    #2 [eed63db0] cifs_async_writev at f7fabcd7 [cifs]
    #3 [eed63df0] cifs_writepages at f7fb7f5c [cifs]
    #4 [eed63e50] do_writepages at c04f3e32
    #5 [eed63e54] __filemap_fdatawrite_range at c04e152a
    #6 [eed63ea4] filemap_fdatawrite at c04e1b3e
    #7 [eed63eb4] cifs_file_aio_write at f7fa111a [cifs]
    #8 [eed63ecc] do_sync_write at c052d202
    #9 [eed63f74] vfs_write at c052d4ee
    #10 [eed63f94] sys_write at c052df4c
    #11 [eed63fb0] ia32_sysenter_target at c0409a98
    EAX: 00000004 EBX: 00000003 ECX: abd73b73 EDX: 012a65c6
    DS: 007b ESI: 012a65c6 ES: 007b EDI: 00000000
    SS: 007b ESP: bf8db178 EBP: bf8db1f8 GS: 0033
    CS: 0073 EIP: 40000424 ERR: 00000004 EFLAGS: 00000246

    Each task would kmap part of its address array before getting stuck, but
    not enough to actually issue the write.

    This patch fixes this by serializing the marshal_iov operations for
    async reads and writes. The idea here is to ensure that cifs
    aggressively tries to populate a request before attempting to fulfill
    another one. As soon as all of the pages are kmapped for a request, then
    we can unlock and allow another one to proceed.

    There's no need to do this serialization on non-CONFIG_HIGHMEM arches
    however, so optimize all of this out when CONFIG_HIGHMEM isn't set.

    Cc:
    Reported-by: Jian Li
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • We currently rely on being able to kmap all of the pages in an async
    read or write request. If you're on a machine that has CONFIG_HIGHMEM
    set then that kmap space is limited, sometimes to as low as 512 slots.

    With 512 slots, we can only support up to a 2M r/wsize, and that's
    assuming that we can get our greedy little hands on all of them. There
    are other users however, so it's possible we'll end up stuck with a
    size that large.

    Since we can't handle a rsize or wsize larger than that currently, cap
    those options at the number of kmap slots we have. We could consider
    capping it even lower, but we currently default to a max of 1M. Might as
    well allow those luddites on 32 bit arches enough rope to hang
    themselves.

    A more robust fix would be to teach the send and receive routines how
    to contend with an array of pages so we don't need to marshal up a kvec
    array at all. That's a fairly significant overhaul though, so we'll need
    this limit in place until that's ready.

    Cc:
    Reported-by: Jian Li
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • A user reported a crash in cifs_demultiplex_thread() caused by an
    incorrectly set mid_q_entry->callback() function. It appears that the
    callback assignment made in cifs_call_async() was not flushed back to
    memory suggesting that a memory barrier was required here. Changing the
    code to make sure that the mid_q_entry structure was completely
    initialised before it was added to the pending queue fixes the problem.

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

    Sachin Prabhu
     
  • Pull xfs regression fixes from Ben Myers:
    - Really fix a cursor leak in xfs_alloc_ag_vextent_near
    - Fix a performance regression related to doing allocation in
    workqueues
    - Prevent recursion in xfs_buf_iorequest which is causing stack
    overflows
    - Don't call xfs_bdstrat_cb in xfs_buf_iodone callbacks

    * tag 'for-linus-v3.5-rc7' of git://oss.sgi.com/xfs/xfs:
    xfs: do not call xfs_bdstrat_cb in xfs_buf_iodone_callbacks
    xfs: prevent recursion in xfs_buf_iorequest
    xfs: don't defer metadata allocation to the workqueue
    xfs: really fix the cursor leak in xfs_alloc_ag_vextent_near

    Linus Torvalds
     

16 Jul, 2012

1 commit

  • If a parent and child process open the two ends of a fifo, and the
    child immediately exits, the parent may receive a SIGCHLD before its
    open() returns. In that case, we need to make sure that open() will
    return successfully after the SIGCHLD handler returns, instead of
    throwing EINTR or being restarted. Otherwise, the restarted open()
    would incorrectly wait for a second partner on the other end.

    The following test demonstrates the EINTR that was wrongly thrown from
    the parent’s open(). Change .sa_flags = 0 to .sa_flags = SA_RESTART
    to see a deadlock instead, in which the restarted open() waits for a
    second reader that will never come. (On my systems, this happens
    pretty reliably within about 5 to 500 iterations. Others report that
    it manages to loop ~forever sometimes; YMMV.)

    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include

    #define CHECK(x) do if ((x) == -1) {perror(#x); abort();} while(0)

    void handler(int signum) {}

    int main()
    {
    struct sigaction act = {.sa_handler = handler, .sa_flags = 0};
    CHECK(sigaction(SIGCHLD, &act, NULL));
    CHECK(mknod("fifo", S_IFIFO | S_IRWXU, 0));
    for (;;) {
    int fd;
    pid_t pid;
    putc('.', stderr);
    CHECK(pid = fork());
    if (pid == 0) {
    CHECK(fd = open("fifo", O_RDONLY));
    _exit(0);
    }
    CHECK(fd = open("fifo", O_WRONLY));
    CHECK(close(fd));
    CHECK(waitpid(pid, NULL, 0));
    }
    }

    This is what I suspect was causing the Git test suite to fail in
    t9010-svn-fe.sh:

    http://bugs.debian.org/678852

    Signed-off-by: Anders Kaseorg
    Reviewed-by: Jonathan Nieder
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Anders Kaseorg
     

14 Jul, 2012

6 commits

  • xfs_bdstrat_cb only adds a check for a shutdown filesystem over
    xfs_buf_iorequest, but xfs_buf_iodone_callbacks just checked for a shut down
    filesystem a little earlier. In addition the shutdown handling in
    xfs_bdstrat_cb is not very suitable for this caller.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner
    Signed-off-by: Ben Myers

    Christoph Hellwig
     
  • If the b_iodone handler is run in calling context in xfs_buf_iorequest we
    can run into a recursion where xfs_buf_iodone_callbacks keeps calling back
    into xfs_buf_iorequest because an I/O error happened, which keeps calling
    back into xfs_buf_iorequest. This chain will usually not take long
    because the filesystem gets shut down because of log I/O errors, but even
    over a short time it can cause stack overflows if run on the same context.

    As a short term workaround make sure we always call the iodone handler in
    workqueue context.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner
    Signed-off-by: Ben Myers

    Christoph Hellwig
     
  • Almost all metadata allocations come from shallow stack usage
    situations. Avoid the overhead of switching the allocation to a
    workqueue as we are not in danger of running out of stack when
    making these allocations. Metadata allocations are already marked
    through the args that are passed down, so this is trivial to do.

    Signed-off-by: Dave Chinner
    Reported-by: Mel Gorman
    Tested-by: Mel Gorman
    Signed-off-by: Ben Myers

    Dave Chinner
     
  • The current cursor is reallocated when retrying the allocation, so
    the existing cursor needs to be destroyed in both the restart and
    the failure cases.

    Signed-off-by: Dave Chinner
    Tested-by: Mike Snitzer
    Signed-off-by: Ben Myers

    Dave Chinner
     
  • Pull NFS client bugfixes from Trond Myklebust:
    - Fix an NFSv4 mount regression
    - Fix O_DIRECT list manipulation snafus

    * tag 'nfs-for-3.5-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    NFSv4: Fix an NFSv4 mount regression
    NFS: Fix list manipulation snafus in fs/nfs/direct.c

    Linus Torvalds
     
  • This can be trivially triggered from userspace by passing in something unexpected.

    kernel BUG at fs/locks.c:1468!
    invalid opcode: 0000 [#1] SMP
    RIP: 0010:generic_setlease+0xc2/0x100
    Call Trace:
    __vfs_setlease+0x35/0x40
    fcntl_setlease+0x76/0x150
    sys_fcntl+0x1c6/0x810
    system_call_fastpath+0x1a/0x1f

    Signed-off-by: Dave Jones
    Cc: stable@kernel.org # 3.2+
    Signed-off-by: Linus Torvalds

    Dave Jones
     

13 Jul, 2012

1 commit

  • Commit 080399aaaf35 ("block: don't mark buffers beyond end of disk as
    mapped") exposed a bug in __getblk_slow that causes mount to hang as it
    loops infinitely waiting for a buffer that lies beyond the end of the
    disk to become uptodate.

    The problem was initially reported by Torsten Hilbrich here:

    https://lkml.org/lkml/2012/6/18/54

    and also reported independently here:

    http://www.sysresccd.org/forums/viewtopic.php?f=13&t=4511

    and then Richard W.M. Jones and Marcos Mello noted a few separate
    bugzillas also associated with the same issue. This patch has been
    confirmed to fix:

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

    The main problem is here, in __getblk_slow:

    for (;;) {
    struct buffer_head * bh;
    int ret;

    bh = __find_get_block(bdev, block, size);
    if (bh)
    return bh;

    ret = grow_buffers(bdev, block, size);
    if (ret < 0)
    return NULL;
    if (ret == 0)
    free_more_memory();
    }

    __find_get_block does not find the block, since it will not be marked as
    mapped, and so grow_buffers is called to fill in the buffers for the
    associated page. I believe the for (;;) loop is there primarily to
    retry in the case of memory pressure keeping grow_buffers from
    succeeding. However, we also continue to loop for other cases, like the
    block lying beond the end of the disk. So, the fix I came up with is to
    only loop when grow_buffers fails due to memory allocation issues
    (return value of 0).

    The attached patch was tested by myself, Torsten, and Rich, and was
    found to resolve the problem in call cases.

    Signed-off-by: Jeff Moyer
    Reported-and-Tested-by: Torsten Hilbrich
    Tested-by: Richard W.M. Jones
    Reviewed-by: Josh Boyer
    Cc: Stable # 3.0+
    [ Jens is on vacation, taking this directly - Linus ]
    --
    Stable Notes: this patch requires backport to 3.0, 3.2 and 3.3.
    Signed-off-by: Linus Torvalds

    Jeff Moyer
     

12 Jul, 2012

3 commits

  • fat_encode_fh() can fetch an invalid i_pos value on systems where 64-bit
    accesses are not atomic. Make it use the same accessor as the rest of the
    FAT code.

    Signed-off-by: Steven J. Magnani
    Acked-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Steven J. Magnani
     
  • There is a bug in the below scenario for !CONFIG_MMU:

    1. create a new file
    2. mmap the file and write to it
    3. read the file can't get the correct value

    Because

    sys_read() -> generic_file_aio_read() -> simple_readpage() -> clear_page()

    which causes the page to be zeroed.

    Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() so that
    generic_file_aio_read() do not call simple_readpage().

    Signed-off-by: Bob Liu
    Cc: Hugh Dickins
    Cc: David Howells
    Cc: Geert Uytterhoeven
    Cc: Greg Ungerer
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bob Liu
     
  • As ocfs2_fallocate() will invoke __ocfs2_change_file_space() with a NULL
    as the first parameter (file), it may trigger a NULL pointer dereferrence
    due to a missing check.

    Addresses http://bugs.launchpad.net/bugs/1006012

    Signed-off-by: Luis Henriques
    Reported-by: Bret Towe
    Tested-by: Bret Towe
    Cc: Sunil Mushran
    Acked-by: Joel Becker
    Acked-by: Mark Fasheh
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Luis Henriques
     

11 Jul, 2012

1 commit

  • The helper nfs_fs_mount() will always call nfs4_try_mount with the
    mount_info->fill_super argument pointing to nfs_fill_super, which is
    NFSv2/v3 only.
    Fix is to have nfs4_try_mount replace it with nfs4_fill_super.

    The regression was introduced by commit c40f8d1d (NFS: Create a common
    fs_mount() function)

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

08 Jul, 2012

2 commits

  • Fix 2 bugs in nfs_direct_write_reschedule:

    - The request needs to be removed from the 'reqs' list before it can
    be added to 'failed'.
    - Fix an infinite loop if the 'failed' list is non-empty.

    Reported-by: Julia Lawall
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • We already use them for openat() and friends, but fchdir() also wants to
    be able to use O_PATH file descriptors. This should make it comparable
    to the O_SEARCH of Solaris. In particular, O_PATH allows you to access
    (not-quite-open) a directory you don't have read persmission to, only
    execute permission.

    Noticed during development of multithread support for ksh93.

    Reported-by: ольга крыжановская
    Cc: Al Viro
    Cc: stable@kernel.org # O_PATH introduced in 3.0+
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

07 Jul, 2012

4 commits

  • Pull eCryptfs fixes from Tyler Hicks:
    "Fixes an incorrect access mode check when preparing to open a file in
    the lower filesystem. This isn't an urgent fix, but it is simple and
    the check was obviously incorrect.

    Also fixes a couple important bugs in the eCryptfs miscdev interface.
    These changes are low risk due to the small number of users that use
    the miscdev interface. I was able to keep the changes minimal and I
    have some cleaner, more complete changes queued up for the next merge
    window that will build on these patches."

    * tag 'ecryptfs-3.5-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
    eCryptfs: Gracefully refuse miscdev file ops on inherited/passed files
    eCryptfs: Fix lockdep warning in miscdev operations
    eCryptfs: Properly check for O_RDONLY flag before doing privileged open

    Linus Torvalds
     
  • File operations on /dev/ecryptfs would BUG() when the operations were
    performed by processes other than the process that originally opened the
    file. This could happen with open files inherited after fork() or file
    descriptors passed through IPC mechanisms. Rather than calling BUG(), an
    error code can be safely returned in most situations.

    In ecryptfs_miscdev_release(), eCryptfs still needs to handle the
    release even if the last file reference is being held by a process that
    didn't originally open the file. ecryptfs_find_daemon_by_euid() will not
    be successful, so a pointer to the daemon is stored in the file's
    private_data. The private_data pointer is initialized when the miscdev
    file is opened and only used when the file is released.

    https://launchpad.net/bugs/994247

    Signed-off-by: Tyler Hicks
    Reported-by: Sasha Levin
    Tested-by: Sasha Levin

    Tyler Hicks
     
  • Pull ocfs2 fixes from Joel Becker.

    * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
    aio: make kiocb->private NUll in init_sync_kiocb()
    ocfs2: Fix bogus error message from ocfs2_global_read_info
    ocfs2: for SEEK_DATA/SEEK_HOLE, return internal error unchanged if ocfs2_get_clusters_nocache() or ocfs2_inode_lock() call failed.
    ocfs2: use spinlock irqsave for downconvert lock.patch
    ocfs2: Misplaced parens in unlikley
    ocfs2: clear unaligned io flag when dio fails

    Linus Torvalds
     
  • Pull cifs fixes from Steve French.

    * git://git.samba.org/sfrench/cifs-2.6:
    cifs: when server doesn't set CAP_LARGE_READ_X, cap default rsize at MaxBufferSize
    cifs: fix parsing of password mount option

    Linus Torvalds
     

06 Jul, 2012

1 commit

  • Pull btrfs updates from Chris Mason:
    "I held off on my rc5 pull because I hit an oops during log recovery
    after a crash. I wanted to make sure it wasn't a regression because
    we have some logging fixes in here.

    It turns out that a commit during the merge window just made it much
    more likely to trigger directory logging instead of full commits,
    which exposed an old bug.

    The new backref walking code got some additional fixes. This should
    be the final set of them.

    Josef fixed up a corner where our O_DIRECT writes and buffered reads
    could expose old file contents (not stale, just not the most recent).
    He and Liu Bo fixed crashes during tree log recover as well.

    Ilya fixed errors while we resume disk balancing operations on
    readonly mounts."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: run delayed directory updates during log replay
    Btrfs: hold a ref on the inode during writepages
    Btrfs: fix tree log remove space corner case
    Btrfs: fix wrong check during log recovery
    Btrfs: use _IOR for BTRFS_IOC_SUBVOL_GETFLAGS
    Btrfs: resume balance on rw (re)mounts properly
    Btrfs: restore restriper state on all mounts
    Btrfs: fix dio write vs buffered read race
    Btrfs: don't count I/O statistic read errors for missing devices
    Btrfs: resolve tree mod log locking issue in btrfs_next_leaf
    Btrfs: fix tree mod log rewind of ADD operations
    Btrfs: leave critical region in btrfs_find_all_roots as soon as possible
    Btrfs: always put insert_ptr modifications into the tree mod log
    Btrfs: fix tree mod log for root replacements at leaf level
    Btrfs: support root level changes in __resolve_indirect_ref
    Btrfs: avoid waiting for delayed refs when we must not

    Linus Torvalds
     

04 Jul, 2012

9 commits

  • 'status' variable in ocfs2_global_read_info() is always != 0 when leaving the
    function because it happens to contain number of read bytes. Thus we always log
    error message although everything is OK. Since all error cases properly call
    mlog_errno() before jumping to out_err, there's no reason to call mlog_errno()
    on exit at all. This is a fallout of c1e8d35e (conversion of mlog_exit()
    calls).

    Signed-off-by: Jan Kara
    Signed-off-by: Joel Becker

    Jan Kara
     
  • …sters_nocache() or ocfs2_inode_lock() call failed.

    Hello,

    Since ENXIO only means "offset beyond EOF" for SEEK_DATA/SEEK_HOLE,
    Hence we should return the internal error unchanged if ocfs2_inode_lock() or
    ocfs2_get_clusters_nocache() call failed rather than ENXIO.
    Otherwise, it will confuse the user applications when they trying to understand the root cause.

    Thanks Dave for pointing this out.

    Thanks,
    -Jeff

    Cc: Dave Chinner <david@fromorbit.com>
    Signed-off-by: Jie Liu <jeff.liu@oracle.com>
    Signed-off-by: Joel Becker <jlbec@evilplan.org>

    Jeff Liu
     
  • When ocfs2dc thread holds dc_task_lock spinlock and receives soft IRQ it
    deadlock itself trying to get same spinlock in ocfs2_wake_downconvert_thread.
    Below is the stack snippet.

    The patch disables interrupts when acquiring dc_task_lock spinlock.

    ocfs2_wake_downconvert_thread
    ocfs2_rw_unlock
    ocfs2_dio_end_io
    dio_complete
    .....
    bio_endio
    req_bio_endio
    ....
    scsi_io_completion
    blk_done_softirq
    __do_softirq
    do_softirq
    irq_exit
    do_IRQ
    ocfs2_downconvert_thread
    [kthread]

    Signed-off-by: Srinivas Eeda
    Signed-off-by: Joel Becker

    Srinivas Eeda
     
  • Fix misplaced parentheses

    Signed-off-by: Roel Kluin
    Signed-off-by: Joel Becker

    roel
     
  • The unaligned io flag is set in the kiocb when an unaligned
    dio is issued, it should be cleared even when the dio fails,
    or it may affect the following io which are using the same
    kiocb.

    Signed-off-by: Junxiao Bi
    Cc: stable@vger.kernel.org
    Signed-off-by: Joel Becker

    Junxiao Bi
     
  • Don't grab the daemon mutex while holding the message context mutex.
    Addresses this lockdep warning:

    ecryptfsd/2141 is trying to acquire lock:
    (&ecryptfs_msg_ctx_arr[i].mux){+.+.+.}, at: [] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs]

    but task is already holding lock:
    (&(*daemon)->mux){+.+...}, at: [] ecryptfs_miscdev_read+0x21c/0x470 [ecryptfs]

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 (&(*daemon)->mux){+.+...}:
    [] lock_acquire+0x9d/0x220
    [] __mutex_lock_common+0x5a/0x4b0
    [] mutex_lock_nested+0x44/0x50
    [] ecryptfs_send_miscdev+0x97/0x120 [ecryptfs]
    [] ecryptfs_send_message+0x134/0x1e0 [ecryptfs]
    [] ecryptfs_generate_key_packet_set+0x2fe/0xa80 [ecryptfs]
    [] ecryptfs_write_metadata+0x108/0x250 [ecryptfs]
    [] ecryptfs_create+0x130/0x250 [ecryptfs]
    [] vfs_create+0xb4/0x120
    [] do_last+0x8c5/0xa10
    [] path_openat+0xd9/0x460
    [] do_filp_open+0x42/0xa0
    [] do_sys_open+0xf8/0x1d0
    [] sys_open+0x21/0x30
    [] system_call_fastpath+0x16/0x1b

    -> #0 (&ecryptfs_msg_ctx_arr[i].mux){+.+.+.}:
    [] __lock_acquire+0x1bf8/0x1c50
    [] lock_acquire+0x9d/0x220
    [] __mutex_lock_common+0x5a/0x4b0
    [] mutex_lock_nested+0x44/0x50
    [] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs]
    [] vfs_read+0xb3/0x180
    [] sys_read+0x4d/0x90
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: Tyler Hicks

    Tyler Hicks
     
  • If the first attempt at opening the lower file read/write fails,
    eCryptfs will retry using a privileged kthread. However, the privileged
    retry should not happen if the lower file's inode is read-only because a
    read/write open will still be unsuccessful.

    The check for determining if the open should be retried was intended to
    be based on the access mode of the lower file's open flags being
    O_RDONLY, but the check was incorrectly performed. This would cause the
    open to be retried by the privileged kthread, resulting in a second
    failed open of the lower file. This patch corrects the check to
    determine if the open request should be handled by the privileged
    kthread.

    Signed-off-by: Tyler Hicks
    Reported-by: Dan Carpenter
    Acked-by: Dan Carpenter

    Tyler Hicks
     
  • Pull block bits from Jens Axboe:
    "As vacation is coming up, thought I'd better get rid of my pending
    changes in my for-linus branch for this iteration. It contains:

    - Two patches for mtip32xx. Killing a non-compliant sysfs interface
    and moving it to debugfs, where it belongs.

    - A few patches from Asias. Two legit bug fixes, and one killing an
    interface that is no longer in use.

    - A patch from Jan, making the annoying partition ioctl warning a bit
    less annoying, by restricting it to !CAP_SYS_RAWIO only.

    - Three bug fixes for drbd from Lars Ellenberg.

    - A fix for an old regression for umem, it hasn't really worked since
    the plugging scheme was changed in 3.0.

    - A few fixes from Tejun.

    - A splice fix from Eric Dumazet, fixing an issue with pipe
    resizing."

    * 'for-linus' of git://git.kernel.dk/linux-block:
    scsi: Silence unnecessary warnings about ioctl to partition
    block: Drop dead function blk_abort_queue()
    block: Mitigate lock unbalance caused by lock switching
    block: Avoid missed wakeup in request waitqueue
    umem: fix up unplugging
    splice: fix racy pipe->buffers uses
    drbd: fix null pointer dereference with on-congestion policy when diskless
    drbd: fix list corruption by failing but already aborted reads
    drbd: fix access of unallocated pages and kernel panic
    xen/blkfront: Add WARN to deal with misbehaving backends.
    blkcg: drop local variable @q from blkg_destroy()
    mtip32xx: Create debugfs entries for troubleshooting
    mtip32xx: Remove 'registers' and 'flags' from sysfs
    blkcg: fix blkg_alloc() failure path
    block: blkcg_policy_cfq shouldn't be used if !CONFIG_CFQ_GROUP_IOSCHED
    block: fix return value on cfq_init() failure
    mtip32xx: Remove version.h header file inclusion
    xen/blkback: Copy id field when doing BLKIF_DISCARD.

    Linus Torvalds
     
  • When the server doesn't advertise CAP_LARGE_READ_X, then MS-CIFS states
    that you must cap the size of the read at the client's MaxBufferSize.
    Unfortunately, testing with many older servers shows that they often
    can't service a read larger than their own MaxBufferSize.

    Since we can't assume what the server will do in this situation, we must
    be conservative here for the default. When the server can't do large
    reads, then assume that it can't satisfy any read larger than its
    MaxBufferSize either.

    Luckily almost all modern servers can do large reads, so this won't
    affect them. This is really just for older win9x and OS/2 era servers.
    Also, note that this patch just governs the default rsize. The admin can
    always override this if he so chooses.

    Cc: # 3.2
    Reported-by: David H. Durgee
    Signed-off-by: Jeff Layton
    Signed-off-by: Steven French

    Jeff Layton
     

03 Jul, 2012

3 commits

  • While we are resolving directory modifications in the
    tree log, we are triggering delayed metadata updates to
    the filesystem btrees.

    This commit forces the delayed updates to run so the
    replay code can find any modifications done. It stops
    us from crashing because the directory deleltion replay
    expects items to be removed immediately from the tree.

    Signed-off-by: Chris Mason
    cc: stable@kernel.org

    Chris Mason
     
  • We can race with unlink and not actually be able to do our igrab in
    btrfs_add_ordered_extent. This will result in all sorts of problems.
    Instead of doing the complicated work to try and handle returning an error
    properly from btrfs_add_ordered_extent, just hold a ref to the inode during
    writepages. If we cannot grab a ref we know we're freeing this inode anyway
    and can just drop the dirty pages on the floor, because screw them we're
    going to invalidate them anyway. Thanks,

    Signed-off-by: Josef Bacik

    Josef Bacik
     
  • The tree log stuff can have allocated space that we end up having split
    across a bitmap and a real extent. The free space code does not deal with
    this, it assumes that if it finds an extent or bitmap entry that the entire
    range must fall within the entry it finds. This isn't necessarily the case,
    so rework the remove function so it can handle this case properly. This
    fixed two panics the user hit, first in the case where the space was
    initially in a bitmap and then in an extent entry, and then the reverse
    case. Thanks,

    Reported-and-tested-by: Shaun Reich
    Signed-off-by: Josef Bacik

    Josef Bacik