1. 01 6月, 2017 4 次提交
  2. 26 5月, 2017 5 次提交
  3. 25 5月, 2017 1 次提交
  4. 19 5月, 2017 1 次提交
  5. 17 5月, 2017 6 次提交
    • J
      fuseblk: Fix warning in super_setup_bdi_name() · 69c8ebf8
      Jan Kara 提交于
      Commit 5f7f7543 "fuse: Convert to separately allocated bdi" didn't
      properly handle fuseblk filesystem. When fuse_bdi_init() is called for
      that filesystem type, sb->s_bdi is already initialized (by
      set_bdev_super()) to point to block device's bdi and consequently
      super_setup_bdi_name() complains about this fact when reseting bdi to
      the private one.
      
      Fix the problem by properly dropping bdi reference in fuse_bdi_init()
      before creating a private bdi in super_setup_bdi_name().
      
      Fixes: 5f7f7543 ("fuse: Convert to separately allocated bdi")
      Reported-by: NRakesh Pandit <rakesh@tuxera.com>
      Tested-by: NRakesh Pandit <rakesh@tuxera.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      69c8ebf8
    • D
      xfs: only return detailed fsmap info if the caller has CAP_SYS_ADMIN · ea9a46e1
      Darrick J. Wong 提交于
      There were a number of handwaving complaints that one could "possibly"
      use inode numbers and extent maps to fingerprint a filesystem hosting
      multiple containers and somehow use the information to guess at the
      contents of other containers and attack them.  Despite the total lack of
      any demonstration that this is actually possible, it's easier to
      restrict access now and broaden it later, so use the rmapbt fsmap
      backends only if the caller has CAP_SYS_ADMIN.  Unprivileged users will
      just have to make do with only getting the free space and static
      metadata placement information.
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NCarlos Maiolino <cmaiolino@redhat.com>
      ea9a46e1
    • Z
      xfs: bad assertion for delalloc an extent that start at i_size · 892d2a5f
      Zorro Lang 提交于
      By run fsstress long enough time enough in RHEL-7, I find an
      assertion failure (harder to reproduce on linux-4.11, but problem
      is still there):
      
        XFS: Assertion failed: (iflags & BMV_IF_DELALLOC) != 0, file: fs/xfs/xfs_bmap_util.c
      
      The assertion is in xfs_getbmap() funciton:
      
        if (map[i].br_startblock == DELAYSTARTBLOCK &&
      -->   map[i].br_startoff <= XFS_B_TO_FSB(mp, XFS_ISIZE(ip)))
                ASSERT((iflags & BMV_IF_DELALLOC) != 0);
      
      When map[i].br_startoff == XFS_B_TO_FSB(mp, XFS_ISIZE(ip)), the
      startoff is just at EOF. But we only need to make sure delalloc
      extents that are within EOF, not include EOF.
      Signed-off-by: NZorro Lang <zlang@redhat.com>
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      892d2a5f
    • D
      xfs: fix warnings about unused stack variables · 6e747506
      Darrick J. Wong 提交于
      Reduce stack usage and get rid of compiler warnings by eliminating
      unused variables.
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NCarlos Maiolino <cmaiolino@redhat.com>
      6e747506
    • D
      xfs: BMAPX shouldn't barf on inline-format directories · 6eadbf4c
      Darrick J. Wong 提交于
      When we're fulfilling a BMAPX request, jump out early if the data fork
      is in local format.  This prevents us from hitting a debugging check in
      bmapi_read and barfing errors back to userspace.  The on-disk extent
      count check later isn't sufficient for IF_DELALLOC mode because da
      extents are in memory and not on disk.
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      6eadbf4c
    • B
      xfs: fix indlen accounting error on partial delalloc conversion · 0daaecac
      Brian Foster 提交于
      The delalloc -> real block conversion path uses an incorrect
      calculation in the case where the middle part of a delalloc extent
      is being converted. This is documented as a rare situation because
      XFS generally attempts to maximize contiguity by converting as much
      of a delalloc extent as possible.
      
      If this situation does occur, the indlen reservation for the two new
      delalloc extents left behind by the conversion of the middle range
      is calculated and compared with the original reservation. If more
      blocks are required, the delta is allocated from the global block
      pool. This delta value can be characterized as the difference
      between the new total requirement (temp + temp2) and the currently
      available reservation minus those blocks that have already been
      allocated (startblockval(PREV.br_startblock) - allocated).
      
      The problem is that the current code does not account for previously
      allocated blocks correctly. It subtracts the current allocation
      count from the (new - old) delta rather than the old indlen
      reservation. This means that more indlen blocks than have been
      allocated end up stashed in the remaining extents and free space
      accounting is broken as a result.
      
      Fix up the calculation to subtract the allocated block count from
      the original extent indlen and thus correctly allocate the
      reservation delta based on the difference between the new total
      requirement and the unused blocks from the original reservation.
      Also remove a bogus assert that contradicts the fact that the new
      indlen reservation can be larger than the original indlen
      reservation.
      Signed-off-by: NBrian Foster <bfoster@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      0daaecac
  6. 14 5月, 2017 1 次提交
    • D
      dax, xfs, ext4: compile out iomap-dax paths in the FS_DAX=n case · f5705aa8
      Dan Williams 提交于
      Tetsuo reports:
      
        fs/built-in.o: In function `xfs_file_iomap_end':
        xfs_iomap.c:(.text+0xe0ef9): undefined reference to `put_dax'
        fs/built-in.o: In function `xfs_file_iomap_begin':
        xfs_iomap.c:(.text+0xe1a7f): undefined reference to `dax_get_by_host'
        make: *** [vmlinux] Error 1
        $ grep DAX .config
        CONFIG_DAX=m
        # CONFIG_DEV_DAX is not set
        # CONFIG_FS_DAX is not set
      
      When FS_DAX=n we can/must throw away the dax code in filesystems.
      Implement 'fs_' versions of dax_get_by_host() and put_dax() that are
      nops in the FS_DAX=n case.
      
      Cc: <linux-xfs@vger.kernel.org>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Jan Kara <jack@suse.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Tested-by: NTony Luck <tony.luck@intel.com>
      Fixes: ef510424 ("block, dax: move 'select DAX' from BLOCK to FS_DAX")
      Reported-by: NTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      f5705aa8
  7. 13 5月, 2017 10 次提交
  8. 11 5月, 2017 3 次提交
  9. 10 5月, 2017 5 次提交
    • S
      Don't delay freeing mids when blocked on slow socket write of request · de1892b8
      Steve French 提交于
      When processing responses, and in particular freeing mids (DeleteMidQEntry),
      which is very important since it also frees the associated buffers (cifs_buf_release),
      we can block a long time if (writes to) socket is slow due to low memory or networking
      issues.
      
      We can block in send (smb request) waiting for memory, and be blocked in processing
      responess (which could free memory if we let it) - since they both grab the
      server->srv_mutex.
      
      In practice, in the DeleteMidQEntry case - there is no reason we need to
      grab the srv_mutex so remove these around DeleteMidQEntry, and it allows
      us to free memory faster.
      Signed-off-by: NSteve French <steve.french@primarydata.com>
      Acked-by: NPavel Shilovsky <pshilov@microsoft.com>
      de1892b8
    • R
      CIFS: silence lockdep splat in cifs_relock_file() · 560d3889
      Rabin Vincent 提交于
      cifs_relock_file() can perform a down_write() on the inode's lock_sem even
      though it was already performed in cifs_strict_readv().  Lockdep complains
      about this.  AFAICS, there is no problem here, and lockdep just needs to be
      told that this nesting is OK.
      
       =============================================
       [ INFO: possible recursive locking detected ]
       4.11.0+ #20 Not tainted
       ---------------------------------------------
       cat/701 is trying to acquire lock:
        (&cifsi->lock_sem){++++.+}, at: cifs_reopen_file+0x7a7/0xc00
      
       but task is already holding lock:
        (&cifsi->lock_sem){++++.+}, at: cifs_strict_readv+0x177/0x310
      
       other info that might help us debug this:
        Possible unsafe locking scenario:
      
              CPU0
              ----
         lock(&cifsi->lock_sem);
         lock(&cifsi->lock_sem);
      
        *** DEADLOCK ***
      
        May be due to missing lock nesting notation
      
       1 lock held by cat/701:
        #0:  (&cifsi->lock_sem){++++.+}, at: cifs_strict_readv+0x177/0x310
      
       stack backtrace:
       CPU: 0 PID: 701 Comm: cat Not tainted 4.11.0+ #20
       Call Trace:
        dump_stack+0x85/0xc2
        __lock_acquire+0x17dd/0x2260
        ? trace_hardirqs_on_thunk+0x1a/0x1c
        ? preempt_schedule_irq+0x6b/0x80
        lock_acquire+0xcc/0x260
        ? lock_acquire+0xcc/0x260
        ? cifs_reopen_file+0x7a7/0xc00
        down_read+0x2d/0x70
        ? cifs_reopen_file+0x7a7/0xc00
        cifs_reopen_file+0x7a7/0xc00
        ? printk+0x43/0x4b
        cifs_readpage_worker+0x327/0x8a0
        cifs_readpage+0x8c/0x2a0
        generic_file_read_iter+0x692/0xd00
        cifs_strict_readv+0x29f/0x310
        generic_file_splice_read+0x11c/0x1c0
        do_splice_to+0xa5/0xc0
        splice_direct_to_actor+0xfa/0x350
        ? generic_pipe_buf_nosteal+0x10/0x10
        do_splice_direct+0xb5/0xe0
        do_sendfile+0x278/0x3a0
        SyS_sendfile64+0xc4/0xe0
        entry_SYSCALL_64_fastpath+0x1f/0xbe
      Signed-off-by: NRabin Vincent <rabinv@axis.com>
      Acked-by: NPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      560d3889
    • A
      nfsd: fix undefined behavior in nfsd4_layout_verify · b550a32e
      Ari Kauppi 提交于
        UBSAN: Undefined behaviour in fs/nfsd/nfs4proc.c:1262:34
        shift exponent 128 is too large for 32-bit type 'int'
      
      Depending on compiler+architecture, this may cause the check for
      layout_type to succeed for overly large values (which seems to be the
      case with amd64). The large value will be later used in de-referencing
      nfsd4_layout_ops for function pointers.
      Reported-by: NJani Tuovila <tuovila@synopsys.com>
      Signed-off-by: NAri Kauppi <ari@synopsys.com>
      [colin.king@canonical.com: use LAYOUT_TYPE_MAX instead of 32]
      Cc: stable@vger.kernel.org
      Reviewed-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      b550a32e
    • T
      pNFS/flexfiles: Always attempt to call layoutstats when flexfiles is enabled · 76b2a303
      Trond Myklebust 提交于
      Layoutstats is always desirable when using the flexfiles driver, so
      we should enable it if that driver is being loaded. It is safe to do
      so, because even when the mount specifies NFSv4.1, we will turn it
      off if the server tells us it is unsupported.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      76b2a303
    • T
      NFSv4.1: Work around a Linux server bug... · f4b23de3
      Trond Myklebust 提交于
      It turns out the Linux server has a bug in its implementation of
      supattr_exclcreat; it returns the set of all attributes, whether
      or not they are supported by minor version 1.
      In order to avoid a regression, we therefore apply the supported_attrs
      as a mask on top of whatever the server sent us.
      Reported-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      f4b23de3
  10. 09 5月, 2017 4 次提交