Skip to content

Commit 6890ad4

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "Final block fixes for 3.16 Four small fixes that should go into 3.16, have been queued up for a bit and delayed due to vacation and other euro duties. But here they are. The pull request contains: - Fix for a reported crash with shared tagging on SCSI from Christoph - A regression fix for drbd. From Lars Ellenberg. - Hooking up the compat ioctl for BLKZEROOUT, which requires no translation. From Mikulas. - A fix for a regression where we woud crash on queue exit if the root_blkg is gone/not there. From Tejun" * 'for-linus' of git://git.kernel.dk/linux-block: block: provide compat ioctl for BLKZEROOUT blkcg: don't call into policy draining if root_blkg is already gone drbd: fix regression 'out of mem, failed to invoke fence-peer helper' block: don't assume last put of shared tags is for the host
2 parents d6e6c48 + 3b3a181 commit 6890ad4

File tree

4 files changed

+21
-26
lines changed

4 files changed

+21
-26
lines changed

block/blk-cgroup.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,13 @@ void blkcg_drain_queue(struct request_queue *q)
872872
{
873873
lockdep_assert_held(q->queue_lock);
874874

875+
/*
876+
* @q could be exiting and already have destroyed all blkgs as
877+
* indicated by NULL root_blkg. If so, don't confuse policies.
878+
*/
879+
if (!q->root_blkg)
880+
return;
881+
875882
blk_throtl_drain(q);
876883
}
877884

block/blk-tag.c

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,15 @@ struct request *blk_queue_find_tag(struct request_queue *q, int tag)
2727
EXPORT_SYMBOL(blk_queue_find_tag);
2828

2929
/**
30-
* __blk_free_tags - release a given set of tag maintenance info
30+
* blk_free_tags - release a given set of tag maintenance info
3131
* @bqt: the tag map to free
3232
*
33-
* Tries to free the specified @bqt. Returns true if it was
34-
* actually freed and false if there are still references using it
33+
* Drop the reference count on @bqt and frees it when the last reference
34+
* is dropped.
3535
*/
36-
static int __blk_free_tags(struct blk_queue_tag *bqt)
36+
void blk_free_tags(struct blk_queue_tag *bqt)
3737
{
38-
int retval;
39-
40-
retval = atomic_dec_and_test(&bqt->refcnt);
41-
if (retval) {
38+
if (atomic_dec_and_test(&bqt->refcnt)) {
4239
BUG_ON(find_first_bit(bqt->tag_map, bqt->max_depth) <
4340
bqt->max_depth);
4441

@@ -50,9 +47,8 @@ static int __blk_free_tags(struct blk_queue_tag *bqt)
5047

5148
kfree(bqt);
5249
}
53-
54-
return retval;
5550
}
51+
EXPORT_SYMBOL(blk_free_tags);
5652

5753
/**
5854
* __blk_queue_free_tags - release tag maintenance info
@@ -69,27 +65,12 @@ void __blk_queue_free_tags(struct request_queue *q)
6965
if (!bqt)
7066
return;
7167

72-
__blk_free_tags(bqt);
68+
blk_free_tags(bqt);
7369

7470
q->queue_tags = NULL;
7571
queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q);
7672
}
7773

78-
/**
79-
* blk_free_tags - release a given set of tag maintenance info
80-
* @bqt: the tag map to free
81-
*
82-
* For externally managed @bqt frees the map. Callers of this
83-
* function must guarantee to have released all the queues that
84-
* might have been using this tag map.
85-
*/
86-
void blk_free_tags(struct blk_queue_tag *bqt)
87-
{
88-
if (unlikely(!__blk_free_tags(bqt)))
89-
BUG();
90-
}
91-
EXPORT_SYMBOL(blk_free_tags);
92-
9374
/**
9475
* blk_queue_free_tags - release tag maintenance info
9576
* @q: the request queue for the device

block/compat_ioctl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
690690
case BLKROSET:
691691
case BLKDISCARD:
692692
case BLKSECDISCARD:
693+
case BLKZEROOUT:
693694
/*
694695
* the ones below are implemented in blkdev_locked_ioctl,
695696
* but we call blkdev_ioctl, which gets the lock for us

drivers/block/drbd/drbd_nl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@ void conn_try_outdate_peer_async(struct drbd_connection *connection)
544544
struct task_struct *opa;
545545

546546
kref_get(&connection->kref);
547+
/* We may just have force_sig()'ed this thread
548+
* to get it out of some blocking network function.
549+
* Clear signals; otherwise kthread_run(), which internally uses
550+
* wait_on_completion_killable(), will mistake our pending signal
551+
* for a new fatal signal and fail. */
552+
flush_signals(current);
547553
opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h");
548554
if (IS_ERR(opa)) {
549555
drbd_err(connection, "out of mem, failed to invoke fence-peer helper\n");

0 commit comments

Comments
 (0)