1. 31 8月, 2019 15 次提交
  2. 30 8月, 2019 1 次提交
  3. 28 8月, 2019 9 次提交
  4. 27 8月, 2019 6 次提交
  5. 25 8月, 2019 1 次提交
  6. 23 8月, 2019 2 次提交
    • D
      xfs: fix missing ILOCK unlock when xfs_setattr_nonsize fails due to EDQUOT · 1fb254aa
      Darrick J. Wong 提交于
      Benjamin Moody reported to Debian that XFS partially wedges when a chgrp
      fails on account of being out of disk quota.  I ran his reproducer
      script:
      
      # adduser dummy
      # adduser dummy plugdev
      
      # dd if=/dev/zero bs=1M count=100 of=test.img
      # mkfs.xfs test.img
      # mount -t xfs -o gquota test.img /mnt
      # mkdir -p /mnt/dummy
      # chown -c dummy /mnt/dummy
      # xfs_quota -xc 'limit -g bsoft=100k bhard=100k plugdev' /mnt
      
      (and then as user dummy)
      
      $ dd if=/dev/urandom bs=1M count=50 of=/mnt/dummy/foo
      $ chgrp plugdev /mnt/dummy/foo
      
      and saw:
      
      ================================================
      WARNING: lock held when returning to user space!
      5.3.0-rc5 #rc5 Tainted: G        W
      ------------------------------------------------
      chgrp/47006 is leaving the kernel with locks still held!
      1 lock held by chgrp/47006:
       #0: 000000006664ea2d (&xfs_nondir_ilock_class){++++}, at: xfs_ilock+0xd2/0x290 [xfs]
      
      ...which is clearly caused by xfs_setattr_nonsize failing to unlock the
      ILOCK after the xfs_qm_vop_chown_reserve call fails.  Add the missing
      unlock.
      
      Reported-by: benjamin.moody@gmail.com
      Fixes: 253f4911 ("xfs: better xfs_trans_alloc interface")
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      Tested-by: NSalvatore Bonaccorso <carnil@debian.org>
      1fb254aa
    • J
      io_uring: add need_resched() check in inner poll loop · 08f5439f
      Jens Axboe 提交于
      The outer poll loop checks for whether we need to reschedule, and
      returns to userspace if we do. However, it's possible to get stuck
      in the inner loop as well, if the CPU we are running on needs to
      reschedule to finish the IO work.
      
      Add the need_resched() check in the inner loop as well. This fixes
      a potential hang if the kernel is configured with
      CONFIG_PREEMPT_VOLUNTARY=y.
      Reported-by: NSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Tested-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      08f5439f
  7. 22 8月, 2019 6 次提交
    • L
      ubifs: Limit the number of pages in shrink_liability · 0af83abb
      Liu Song 提交于
      If the number of dirty pages to be written back is large,
      then writeback_inodes_sb will block waiting for a long time,
      causing hung task detection alarm. Therefore, we should limit
      the maximum number of pages written back this time, which let
      the budget be completed faster. The remaining dirty pages
      tend to rely on the writeback mechanism to complete the
      synchronization.
      
      Fixes: b6e51316 ("writeback: separate starting of sync vs opportunistic writeback")
      Signed-off-by: NLiu Song <liu.song11@zte.com.cn>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      0af83abb
    • R
      ubifs: Correctly initialize c->min_log_bytes · 377e208f
      Richard Weinberger 提交于
      Currently on a freshly mounted UBIFS, c->min_log_bytes is 0.
      This can lead to a log overrun and make commits fail.
      
      Recent kernels will report the following assert:
      UBIFS assert failed: c->lhead_lnum != c->ltail_lnum, in fs/ubifs/log.c:412
      
      c->min_log_bytes can have two states, 0 and c->leb_size.
      It controls how much bytes of the log area are reserved for non-bud
      nodes such as commit nodes.
      
      After a commit it has to be set to c->leb_size such that we have always
      enough space for a commit. While a commit runs it can be 0 to make the
      remaining bytes of the log available to writers.
      
      Having it set to 0 right after mount is wrong since no space for commits
      is reserved.
      
      Fixes: 1e51764a ("UBIFS: add new flash file system")
      Reported-and-tested-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      377e208f
    • R
      ubifs: Fix double unlock around orphan_delete() · 4dd75b33
      Richard Weinberger 提交于
      We unlock after orphan_delete(), so no need to unlock
      in the function too.
      Reported-by: NHan Xu <han.xu@nxp.com>
      Fixes: 8009ce95 ("ubifs: Don't leak orphans on memory during commit")
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      4dd75b33
    • Y
      afs: use correct afs_call_type in yfs_fs_store_opaque_acl2 · 7533be85
      YueHaibing 提交于
      It seems that 'yfs_RXYFSStoreOpaqueACL2' should be use in
      yfs_fs_store_opaque_acl2().
      
      Fixes: f5e45463 ("afs: Implement YFS ACL setting")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      7533be85
    • M
      afs: Fix possible oops in afs_lookup trace event · c4c613ff
      Marc Dionne 提交于
      The afs_lookup trace event can cause the following:
      
      [  216.576777] BUG: kernel NULL pointer dereference, address: 000000000000023b
      [  216.576803] #PF: supervisor read access in kernel mode
      [  216.576813] #PF: error_code(0x0000) - not-present page
      ...
      [  216.576913] RIP: 0010:trace_event_raw_event_afs_lookup+0x9e/0x1c0 [kafs]
      
      If the inode from afs_do_lookup() is an error other than ENOENT, or if it
      is ENOENT and afs_try_auto_mntpt() returns an error, the trace event will
      try to dereference the error pointer as a valid pointer.
      
      Use IS_ERR_OR_NULL to only pass a valid pointer for the trace, or NULL.
      
      Ideally the trace would include the error value, but for now just avoid
      the oops.
      
      Fixes: 80548b03 ("afs: Add more tracepoints")
      Signed-off-by: NMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      c4c613ff
    • D
      afs: Fix leak in afs_lookup_cell_rcu() · a5fb8e6c
      David Howells 提交于
      Fix a leak on the cell refcount in afs_lookup_cell_rcu() due to
      non-clearance of the default error in the case a NULL cell name is passed
      and the workstation default cell is used.
      
      Also put a bit at the end to make sure we don't leak a cell ref if we're
      going to be returning an error.
      
      This leak results in an assertion like the following when the kafs module is
      unloaded:
      
      	AFS: Assertion failed
      	2 == 1 is false
      	0x2 == 0x1 is false
      	------------[ cut here ]------------
      	kernel BUG at fs/afs/cell.c:770!
      	...
      	RIP: 0010:afs_manage_cells+0x220/0x42f [kafs]
      	...
      	 process_one_work+0x4c2/0x82c
      	 ? pool_mayday_timeout+0x1e1/0x1e1
      	 ? do_raw_spin_lock+0x134/0x175
      	 worker_thread+0x336/0x4a6
      	 ? rescuer_thread+0x4af/0x4af
      	 kthread+0x1de/0x1ee
      	 ? kthread_park+0xd4/0xd4
      	 ret_from_fork+0x24/0x30
      
      Fixes: 989782dc ("afs: Overhaul cell database management")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      a5fb8e6c