Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1208394 > unrolled thread
| Started by | Markus Pargmann <mpa@pengutronix.de> |
|---|---|
| First post | 2015-08-17 08:30 +0200 |
| Last post | 2015-08-17 16:30 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PULL 00/10] NBD updates for 4.3 Markus Pargmann <mpa@pengutronix.de> - 2015-08-17 08:30 +0200
[PATCH 05/10] nbd: Move clear queue debug message Markus Pargmann <mpa@pengutronix.de> - 2015-08-17 08:30 +0200
[PATCH 02/10] nbd: sock_shutdown, remove conditional lock Markus Pargmann <mpa@pengutronix.de> - 2015-08-17 08:30 +0200
Re: [PULL 00/10] NBD updates for 4.3 Jens Axboe <axboe@kernel.dk> - 2015-08-17 16:30 +0200
| From | Markus Pargmann <mpa@pengutronix.de> |
|---|---|
| Date | 2015-08-17 08:30 +0200 |
| Subject | [PULL 00/10] NBD updates for 4.3 |
| Message-ID | <pYm5I-7AK-3@gated-at.bofh.it> |
Hi Jens,
I hope this is not too late. Here are some NBD updates.
The most interesting one is probably the first patch, which improves the
timeout detection of NBD. The timout covers now the last reaction of the
server. If there are open requests and we don't receive anything from the
server within the timeout, the connection is killed.
The rest of the patches are smaller cleanups and some new debugfs entries about
the internal state of NBD.
Best Regards,
Markus
The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:
Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)
are available in the git repository at:
git://git.pengutronix.de/git/mpa/linux-nbd.git tags/nbd-for-4.3
for you to fetch changes up to 9bdcdf81aca98816fae86c724855e263454010f0:
nbd: flags is a u32 variable (2015-08-17 08:08:50 +0200)
----------------------------------------------------------------
NBD updates for 4.3
----------------------------------------------------------------
Markus Pargmann (10):
nbd: Fix timeout detection
nbd: sock_shutdown, remove conditional lock
nbd: restructure sock_shutdown
nbd: Remove 'harderror' and propagate error properly
nbd: Move clear queue debug message
nbd: Remove variable 'pid'
nbd: Add debugfs entries
nbd: Change 'disconnect' to be boolean
nbd: Rename functions for clearness of recv/send path
nbd: flags is a u32 variable
drivers/block/nbd.c | 362 +++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 290 insertions(+), 72 deletions(-)
--
2.4.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Markus Pargmann <mpa@pengutronix.de> |
|---|---|
| Date | 2015-08-17 08:30 +0200 |
| Subject | [PATCH 05/10] nbd: Move clear queue debug message |
| Message-ID | <pYm5J-7AK-25@gated-at.bofh.it> |
| In reply to | #1208394 |
This message was a warning without a reason. This patch moves it into nbd_clear_que and transforms it to a debug message. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> --- drivers/block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 8bce05d0df5e..5601523a8336 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -468,6 +468,7 @@ static void nbd_clear_que(struct nbd_device *nbd) req->errors++; nbd_end_request(nbd, req); } + dev_dbg(disk_to_dev(nbd->disk), "queue cleared\n"); } @@ -740,7 +741,6 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, sock = nbd->sock; nbd->sock = NULL; nbd_clear_que(nbd); - dev_warn(disk_to_dev(nbd->disk), "queue cleared\n"); kill_bdev(bdev); queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue); set_device_ro(bdev, false); -- 2.4.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Markus Pargmann <mpa@pengutronix.de> |
|---|---|
| Date | 2015-08-17 08:30 +0200 |
| Subject | [PATCH 02/10] nbd: sock_shutdown, remove conditional lock |
| Message-ID | <pYm5J-7AK-27@gated-at.bofh.it> |
| In reply to | #1208394 |
Move the conditional lock from sock_shutdown into the surrounding code.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
drivers/block/nbd.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 7b9ae7a65c1e..ff59093c5dc1 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -117,18 +117,14 @@ static void nbd_end_request(struct nbd_device *nbd, struct request *req)
/*
* Forcibly shutdown the socket causing all listeners to error
*/
-static void sock_shutdown(struct nbd_device *nbd, int lock)
+static void sock_shutdown(struct nbd_device *nbd)
{
- if (lock)
- mutex_lock(&nbd->tx_lock);
if (nbd->sock) {
dev_warn(disk_to_dev(nbd->disk), "shutting down socket\n");
kernel_sock_shutdown(nbd->sock, SHUT_RDWR);
nbd->sock = NULL;
del_timer_sync(&nbd->timeout_timer);
}
- if (lock)
- mutex_unlock(&nbd->tx_lock);
}
static void nbd_xmit_timeout(unsigned long arg)
@@ -427,7 +423,9 @@ static int nbd_do_it(struct nbd_device *nbd)
ret = dequeue_signal_lock(current, ¤t->blocked, &info);
dev_warn(nbd_to_dev(nbd), "pid %d, %s, got signal %d\n",
task_pid_nr(current), current->comm, ret);
- sock_shutdown(nbd, 1);
+ mutex_lock(&nbd->tx_lock);
+ sock_shutdown(nbd);
+ mutex_unlock(&nbd->tx_lock);
ret = -ETIMEDOUT;
}
@@ -541,7 +539,9 @@ static int nbd_thread(void *data)
&info);
dev_warn(nbd_to_dev(nbd), "pid %d, %s, got signal %d\n",
task_pid_nr(current), current->comm, ret);
- sock_shutdown(nbd, 1);
+ mutex_lock(&nbd->tx_lock);
+ sock_shutdown(nbd);
+ mutex_unlock(&nbd->tx_lock);
break;
}
@@ -735,7 +735,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
mutex_lock(&nbd->tx_lock);
if (error)
return error;
- sock_shutdown(nbd, 0);
+ sock_shutdown(nbd);
sock = nbd->sock;
nbd->sock = NULL;
nbd_clear_que(nbd);
--
2.4.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Jens Axboe <axboe@kernel.dk> |
|---|---|
| Date | 2015-08-17 16:30 +0200 |
| Message-ID | <pYtAe-1tC-3@gated-at.bofh.it> |
| In reply to | #1208394 |
On 08/17/2015 12:19 AM, Markus Pargmann wrote: > Hi Jens, > > I hope this is not too late. Here are some NBD updates. > > The most interesting one is probably the first patch, which improves the > timeout detection of NBD. The timout covers now the last reaction of the > server. If there are open requests and we don't receive anything from the > server within the timeout, the connection is killed. > > The rest of the patches are smaller cleanups and some new debugfs entries about > the internal state of NBD. Applied for 4.3, thanks. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web