1. 03 Sep, 2020 1 commit
    • Hou Pu's avatar
      scsi: target: iscsi: Fix hang in iscsit_access_np() when getting tpg->np_login_sem · ed43ffea
      Hou Pu authored
      The iSCSI target login thread might get stuck with the following stack:
      
      cat /proc/`pidof iscsi_np`/stack
      [<0>] down_interruptible+0x42/0x50
      [<0>] iscsit_access_np+0xe3/0x167
      [<0>] iscsi_target_locate_portal+0x695/0x8ac
      [<0>] __iscsi_target_login_thread+0x855/0xb82
      [<0>] iscsi_target_login_thread+0x2f/0x5a
      [<0>] kthread+0xfa/0x130
      [<0>] ret_from_fork+0x1f/0x30
      
      This can be reproduced via the following steps:
      
      1. Initiator A tries to log in to iqn1-tpg1 on port 3260. After finishing
         PDU exchange in the login thread and before the negotiation is finished
         the the network link goes down. At this point A has not finished login
         and tpg->np_login_sem is held.
      
      2. Initiator B tries to log in to iqn2-tpg1 on port 3260. After finishing
         PDU exchange in the login thread the target expects to process remaining
         login PDUs in workqueue context.
      
      3. Initiator A' tries to log in to iqn1-tpg1 on port 3260 from a new
         socket. A' will wait for tpg->np_login_sem with np->np_login_timer
         loaded to wait for at most 15 seconds. The lock is held by A so A'
         eventually times out.
      
      4. Before A' got timeout initiator B gets negotiation failed and calls
         iscsi_target_login_drop()->iscsi_target_login_sess_out().  The
         np->np_login_timer is canceled and initiator A' will hang forever.
         Because A' is now in the login thread, no new login requests can be
         serviced.
      
      Fix this by moving iscsi_stop_login_thread_timer() out of
      iscsi_target_login_sess_out(). Also remove iscsi_np parameter from
      iscsi_target_login_sess_out().
      
      Link: https://lore.kernel.org/r/20200729130343.24976-1-houpu@bytedance.com
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMike Christie <michael.christie@oracle.com>
      Signed-off-by: default avatarHou Pu <houpu@bytedance.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      ed43ffea
  2. 02 Sep, 2020 2 commits
  3. 01 Sep, 2020 7 commits
  4. 25 Aug, 2020 3 commits
  5. 18 Aug, 2020 23 commits
  6. 16 Aug, 2020 4 commits
    • Linus Torvalds's avatar
      Linux 5.9-rc1 · 9123e3a7
      Linus Torvalds authored
      9123e3a7
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.9-2020-08-15' of git://git.kernel.dk/linux-block · 2cc3c4b3
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A few differerent things in here.
      
        Seems like syzbot got some more io_uring bits wired up, and we got a
        handful of reports and the associated fixes are in here.
      
        General fixes too, and a lot of them marked for stable.
      
        Lastly, a bit of fallout from the async buffered reads, where we now
        more easily trigger short reads. Some applications don't really like
        that, so the io_read() code now handles short reads internally, and
        got a cleanup along the way so that it's now easier to read (and
        documented). We're now passing tests that failed before"
      
      * tag 'io_uring-5.9-2020-08-15' of git://git.kernel.dk/linux-block:
        io_uring: short circuit -EAGAIN for blocking read attempt
        io_uring: sanitize double poll handling
        io_uring: internally retry short reads
        io_uring: retain iov_iter state over io_read/io_write calls
        task_work: only grab task signal lock when needed
        io_uring: enable lookup of links holding inflight files
        io_uring: fail poll arm on queue proc failure
        io_uring: hold 'ctx' reference around task_work queue + execute
        fs: RWF_NOWAIT should imply IOCB_NOIO
        io_uring: defer file table grabbing request cleanup for locked requests
        io_uring: add missing REQ_F_COMP_LOCKED for nested requests
        io_uring: fix recursive completion locking on oveflow flush
        io_uring: use TWA_SIGNAL for task_work uncondtionally
        io_uring: account locked memory before potential error case
        io_uring: set ctx sq/cq entry count earlier
        io_uring: Fix NULL pointer dereference in loop_rw_iter()
        io_uring: add comments on how the async buffered read retry works
        io_uring: io_async_buf_func() need not test page bit
      2cc3c4b3
    • Mike Rapoport's avatar
      parisc: fix PMD pages allocation by restoring pmd_alloc_one() · 6f6aea7e
      Mike Rapoport authored
      Commit 1355c31e ("asm-generic: pgalloc: provide generic pmd_alloc_one()
      and pmd_free_one()") converted parisc to use generic version of
      pmd_alloc_one() but it missed the fact that parisc uses order-1 pages for
      PMD.
      
      Restore the original version of pmd_alloc_one() for parisc, just use
      GFP_PGTABLE_KERNEL that implies __GFP_ZERO instead of GFP_KERNEL and
      memset.
      
      Fixes: 1355c31e ("asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()")
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Tested-by: default avatarMeelis Roos <mroos@linux.ee>
      Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Link: https://lkml.kernel.org/r/9f2b5ebd-e4a4-0fa1-6cd3-4b9f6892d1ad@linux.eeSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6f6aea7e
    • Linus Torvalds's avatar
      Merge tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block · 4b6c093e
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A few fixes on the block side of things:
      
         - Discard granularity fix (Coly)
      
         - rnbd cleanups (Guoqing)
      
         - md error handling fix (Dan)
      
         - md sysfs fix (Junxiao)
      
         - Fix flush request accounting, which caused an IO slowdown for some
           configurations (Ming)
      
         - Properly propagate loop flag for partition scanning (Lennart)"
      
      * tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block:
        block: fix double account of flush request's driver tag
        loop: unset GENHD_FL_NO_PART_SCAN on LOOP_CONFIGURE
        rnbd: no need to set bi_end_io in rnbd_bio_map_kern
        rnbd: remove rnbd_dev_submit_io
        md-cluster: Fix potential error pointer dereference in resize_bitmaps()
        block: check queue's limits.discard_granularity in __blkdev_issue_discard()
        md: get sysfs entry after redundancy attr group create
      4b6c093e