[PATCH 2/2] blktests: block/025: an io.latency test

2018-12-05 Thread Josef Bacik
the slow group get throttled until the first cgroup is able to finish, and then the slow cgroup will be allowed to finish. Signed-off-by: Josef Bacik --- tests/block/025 | 133 tests/block/025.out | 1 + 2 files changed, 134 insertions

[PATCH 1/2] blktests: add cgroup2 infrastructure

2018-12-05 Thread Josef Bacik
is always in a clean state. Signed-off-by: Josef Bacik --- check | 2 ++ common/rc | 48 2 files changed, 50 insertions(+) diff --git a/check b/check index ebd87c097e25..1c9dbc518fa1 100755 --- a/check +++ b/check @@ -294,6 +294,8 @@ _cleanup

[PATCH 0/2][V2] io.latency test for blktests

2018-12-05 Thread Josef Bacik
v1->v2: - dropped my python library, TIL about jq. - fixed the spelling mistakes in the test. -- Original message -- This patchset is to add a test to verify io.latency is working properly, and to add all the supporting code to run that test. First is the cgroup2 infrastructure which is fairly

[PATCH 0/3] Unify the throttling code for wbt and io-latency

2018-12-04 Thread Josef Bacik
Originally when I wrote io-latency and the rq_qos code to provide a common base between wbt and io-latency I left out the throttling part. These were basically the same, but slightly different in both cases. The difference was enough and the code wasn't too complicated that I just copied it into

[PATCH 1/3] block: add rq_qos_wait to rq_qos

2018-12-04 Thread Josef Bacik
to do their own thing as appropriate. Signed-off-by: Josef Bacik --- block/blk-rq-qos.c | 86 ++ block/blk-rq-qos.h | 6 2 files changed, 92 insertions(+) diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c index 80f603b76f61..e932ef9d2718

[PATCH 2/3] block: convert wbt_wait() to use rq_qos_wait()

2018-12-04 Thread Josef Bacik
Now that we have rq_qos_wait() in place, convert wbt_wait() over to using it with it's specific callbacks. Signed-off-by: Josef Bacik --- block/blk-wbt.c | 65 ++--- 1 file changed, 11 insertions(+), 54 deletions(-) diff --git a/block/blk

[PATCH 3/3] block: convert io-latency to use rq_qos_wait

2018-12-04 Thread Josef Bacik
Now that we have this common helper, convert io-latency over to use it as well. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 31 --- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index

[PATCH 1/3] blktests: add cgroup2 infrastructure

2018-12-04 Thread Josef Bacik
is always in a clean state. Signed-off-by: Josef Bacik --- check | 2 ++ common/rc | 48 2 files changed, 50 insertions(+) diff --git a/check b/check index ebd87c097e25..1c9dbc518fa1 100755 --- a/check +++ b/check @@ -294,6 +294,8 @@ _cleanup

[PATCH 0/3] io.latency test for blktests

2018-12-04 Thread Josef Bacik
This patchset is to add a test to verify io.latency is working properly, and to add all the supporting code to run that test. First is the cgroup2 infrastructure which is fairly straightforward. Just verifies we have cgroup2, and gives us the helpers to check and make sure we have the right

[PATCH 3/3] blktests: block/025: an io.latency test

2018-12-04 Thread Josef Bacik
the slow group get throttled until the first cgroup is able to finish, and then the slow cgroup will be allowed to finish. Signed-off-by: Josef Bacik --- tests/block/025 | 133 tests/block/025.out | 1 + 2 files changed, 134 insertions

[PATCH] blk-wbt: wake up all when we scale up, not down

2018-10-11 Thread Josef Bacik
and simply puts everything back the way it was. cc: sta...@vger.kernel.org Fixes: a79050434b45 ("blk-rq-qos: refactor out common elements of blk-wbt") eported-by: Tetsuo Handa Signed-off-by: Josef Bacik --- JENS! I did this on for-4.20/block FYI block/blk-wbt.c | 2 +- 1 file changed, 1

[PATCH 5/5] blk-iolatency: keep track of previous windows stats

2018-09-28 Thread Josef Bacik
we could unthrottle when previous windows we were missing our target. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index fd246805b0be..35c48d7b8f78 100644

[PATCH 0/5][v2] blk-iolatency: Fixes and tweak the miss algo for ssds

2018-09-28 Thread Josef Bacik
v1->v2: - rebased onto a recent for-4.20/block branch - dropped the changed variable cleanup. -- Original message -- Testing on ssd's with the current iolatency code wasn't working quite as well. This is mostly because ssd's don't behave like rotational drives, they are more spikey which means

[PATCH 1/5] blk-iolatency: use q->nr_requests directly

2018-09-28 Thread Josef Bacik
we actually care about. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 27c14f8d2576..c2e38bc12f27 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -25

[PATCH 3/5] blk-iolatency: deal with small samples

2018-09-28 Thread Josef Bacik
if there aren't enough. Make the floor 1 sample to keep us from improperly bailing out of scaling down. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 8daea7a4fe49

[PATCH 4/5] blk-iolatency: use a percentile approache for ssd's

2018-09-28 Thread Josef Bacik
are seeing the same throttling behavior with our testcase on ssd's as we see with rotational drives. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 179 -- 1 file changed, 145 insertions(+), 34 deletions(-) diff --git a/block/blk-iolatency.c

[PATCH 2/5] blk-iolatency: deal with nr_requests == 1

2018-09-28 Thread Josef Bacik
request this if statement is not needed, and this allows us to set our depth to 1 which allows us to apply the delay if needed. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c

[PATCH 6/6] blk-iolatency: keep track of previous windows stats

2018-09-10 Thread Josef Bacik
we could unthrottle when previous windows we were missing our target. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index e36b949a5696..14c30e01ecc7 100644

[PATCH 5/6] blk-iolatency: use a percentile approache for ssd's

2018-09-10 Thread Josef Bacik
are seeing the same throttling behavior with our testcase on ssd's as we see with rotational drives. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 179 -- 1 file changed, 145 insertions(+), 34 deletions(-) diff --git a/block/blk-iolatency.c

[PATCH 4/6] blk-iolatency: deal with small samples

2018-09-10 Thread Josef Bacik
if there aren't enough. Make the floor 1 sample to keep us from improperly bailing out of scaling down. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 4ed05d09a69e

[PATCH 3/6] blk-iolatency: deal with nr_requests == 1

2018-09-10 Thread Josef Bacik
request this if statement is not needed, and this allows us to set our depth to 1 which allows us to apply the delay if needed. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c

[PATCH 2/6] blk-iolatency: delete changed variable

2018-09-10 Thread Josef Bacik
This was from a previous iteration when we returned whether or not we changed the scale. It is unused so remove it. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 9b8d2012ea88

[PATCH 1/6] blk-iolatency: use q->nr_requests directly

2018-09-10 Thread Josef Bacik
we actually care about. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 19923f8a029d..9b8d2012ea88 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -25

Re: [PATCH] blk-wbt: don't maintain inflight counts if disabled

2018-08-23 Thread Josef Bacik
request. > > Fixes: Fixes: c1c80384c8f ("block: remove external dependency on wbt_flags") > Signed-off-by: Jens Axboe > Reviewed-by: Josef Bacik Sorry about that, Josef

Re: [Bug] block/for-next: IO hang in rq_qos_throttle

2018-07-31 Thread Josef Bacik
On Sat, Jul 28, 2018 at 08:11:33PM +0800, Ming Lei wrote: > On Fri, Jul 27, 2018 at 11:47 PM, Josef Bacik wrote: > > On Sun, Jul 22, 2018 at 03:28:05PM +0800, Ming Lei wrote: > >> On Sun, Jul 22, 2018 at 02:15:38AM +, Josef Bacik wrote: > >> > Yup I sent a pat

[PATCH 3/3] blk-cgroup: clear the throttle queue on fork

2018-07-31 Thread Josef Bacik
for the sins of its father. Signed-off-by: Josef Bacik --- kernel/fork.c | 5 + 1 file changed, 5 insertions(+) diff --git a/kernel/fork.c b/kernel/fork.c index 9440d61b925c..694ae0e56866 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -843,6 +843,11 @@ static struct task_struct

[PATCH 2/3] blk-cgroup: hold the queue ref during throttling

2018-07-31 Thread Josef Bacik
The blkg lifetime is protected by the queue lifetime, so we need to put the queue _after_ we're done using the blkg. Signed-off-by: Josef Bacik --- block/blk-cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 1942357d7165

[PATCH 1/3] blk-iolatency: fix blkg leak in timer_fn

2018-07-31 Thread Josef Bacik
At this point we have a ref on the blkg, we need to drop it if we don't have a iolat. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index bb59b2929e0d..b0dc4fc64b3e 100644

[PATCH 0/3] blk-iolatency related ref counting fixes

2018-07-31 Thread Josef Bacik
These are three ref counting issues we found in testing. They are pretty straightforward, the first two don't really happen in practice but need to be fixed, but the last one fixes a real panic we saw pretty regularly in our stress testing. They've been running on our test boxes internally under

[PATCH][v3] block: don't account for split bio's size in cgroup stats

2018-07-30 Thread Josef Bacik
We need to check in blkcg_bio_issue_check if the bio is flagged as QUEUE_ENTERED, because if it is then we've already accounted for the size of the IO in the cgroup stats. We can still however account for the extra IO since it'll be another request. Reported-by: Tejun Heo Signed-off-by: Josef

[PATCH][v2] block: don't account for split bio's size in cgroup stats

2018-07-30 Thread Josef Bacik
We need to check in blkcg_bio_issue_check if the bio is flagged as QUEUE_ENTERED, because if it is then we've already accounted for the size of the IO in the cgroup stats. We can still however account for the extra IO since it'll be another request. Reported-by: Tejun Heo Signed-off-by: Josef

Re: [PATCH] block: don't do cgroup accounting for split bio's

2018-07-27 Thread Josef Bacik
On Fri, Jul 27, 2018 at 03:17:11PM -0600, Jens Axboe wrote: > On 7/27/18 3:14 PM, Josef Bacik wrote: > > We need to check in blkcg_bio_issue_check if the bio is flagged as > > QUEUE_ENTERED, because if it is then we've already accounted for the IO > > in the cgroup sta

[PATCH] block: don't do cgroup accounting for split bio's

2018-07-27 Thread Josef Bacik
We need to check in blkcg_bio_issue_check if the bio is flagged as QUEUE_ENTERED, because if it is then we've already accounted for the IO in the cgroup stats. Reported-by: Tejun Heo Signed-off-by: Josef Bacik --- include/linux/blk-cgroup.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

Re: [Bug] block/for-next: IO hang in rq_qos_throttle

2018-07-27 Thread Josef Bacik
On Sun, Jul 22, 2018 at 03:28:05PM +0800, Ming Lei wrote: > On Sun, Jul 22, 2018 at 02:15:38AM +0000, Josef Bacik wrote: > > Yup I sent a patch for this on Thursday, sorry about that, > > > > I just applied the patch of 'blk-rq-qos: make depth comparisons unsigned', > lo

Re: [Bug] block/for-next: IO hang in rq_qos_throttle

2018-07-22 Thread Josef Bacik
Ugh crap it’s in wbt. I’ll take a look when I’m back from vacation. Thanks, Josef Sent from my iPhone > On Jul 22, 2018, at 3:28 AM, Ming Lei wrote: > >> On Sun, Jul 22, 2018 at 02:15:38AM +, Josef Bacik wrote: >> Yup I sent a patch for this on Thursday, sorry abou

Re: [Bug] block/for-next: IO hang in rq_qos_throttle

2018-07-21 Thread Josef Bacik
Yup I sent a patch for this on Thursday, sorry about that, Josef Sent from my iPhone > On Jul 21, 2018, at 7:22 PM, Ming Lei wrote: > > Hi, > > The following IO hang is triggered on dbench test on xfs/usb-storage, > and the test > is run on the latest for-next/block(commit 93d8cf625a32). >

[PATCH] blk-rq-qos: make depth comparisons unsigned

2018-07-19 Thread Josef Bacik
With the change to use UINT_MAX I broke the depth check as any value of inflight (ie 0) would be less than (int)UINT_MAX. Fix this by changing everything to unsigned int to match the depth. Signed-off-by: Josef Bacik --- block/blk-rq-qos.c | 8 block/blk-rq-qos.h | 2 +- 2 files

[PATCH 2/2] blk-iolatency: truncate our current time

2018-07-16 Thread Josef Bacik
From: Josef Bacik In our longer tests we noticed that some boxes would degrade to the point of uselessness. This is because we truncate the current time when saving it in our bio, but I was using the raw current time to subtract from. So once the box had been up a certain amount of time

[PATCH 1/2] blk-iolatency: don't change the latency window

2018-07-16 Thread Josef Bacik
From: Josef Bacik Early versions of these patches had us waiting for seconds at a time during submission, so we had to adjust the timing window we monitored for latency. Now we don't do things like that so this is unnecessary code. Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 10

[PATCH 1/2] nbd: don't requeue the same request twice.

2018-07-16 Thread Josef Bacik
be marked complete and still requeue. Instead add a flag to the socket so we know whether we've been requeued yet. Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c

[PATCH 2/2] nbd: handle unexpected replies better

2018-07-16 Thread Josef Bacik
. Add a per command cookie as well so that we can know if we're getting a double completion for a previous event. Also check to make sure we dont have REQUEUED set as that means we raced with the timeout handler and need to just let the retry occur. Signed-off-by: Josef Bacik --- drivers/block/nbd.c

[PATCH][v2] blk-iolatency: fix max_depth comparisons

2018-07-11 Thread Josef Bacik
max_depth used to be a u64, but I changed it to a unsigned int but didn't convert my comparisons over everywhere. Fix by using UINT_MAX everywhere instead of (u64)-1. Reported-by: Dan Carpenter Signed-off-by: Josef Bacik --- - use UINT_MAX instead of INT_MAX. block/blk-iolatency.c | 12

Re: [PATCH] blk-iolatency: fix max_depth comparisons

2018-07-11 Thread Josef Bacik
On Wed, Jul 11, 2018 at 08:22:28AM -0600, Jens Axboe wrote: > On 7/11/18 7:30 AM, Josef Bacik wrote: > > max_depth used to be a u64, but I changed it to a unsigned int but > > didn't convert my comparisons over everywhere. Fix by comparing to > > INT_MAX instead of

[PATCH] blk-iolatency: fix max_depth comparisons

2018-07-11 Thread Josef Bacik
max_depth used to be a u64, but I changed it to a unsigned int but didn't convert my comparisons over everywhere. Fix by comparing to INT_MAX instead of (u64)-1. Reported-by: Dan Carpenter Signed-off-by: Josef Bacik --- block/blk-iolatency.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] nbd: set discard_alignment to the granularity

2018-06-05 Thread Josef Bacik
will actually work properly with 4k drives. Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index bdfbb2a7018c..ec9b43c9f7e3 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -238,6 +238,7

Re: [PATCH] nbd: Consistently use request pointer in debug messages.

2018-06-05 Thread Josef Bacik
to > > follow request flow. Consistently use request pointer instead. > > You're missing the Signed-off-by. > Blah sorry, still a little foggy, Signed-off-by: Josef Bacik Thanks, Josef

Re: [PATCH] nbd: Consistently use request pointer in debug messages.

2018-06-05 Thread Josef Bacik
pointer instead. Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH] nbd: clear DISCONNECT_REQUESTED flag once disconnection occurs.

2018-05-30 Thread Josef Bacik
you want to put the changelog after the --- bit below so we can all see it but it doesn't end up in the git changelog. Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH] blk-mq: only iterate over inflight requests in blk_mq_tagset_busy_iter

2018-05-30 Thread Josef Bacik
On Wed, May 30, 2018 at 06:51:00PM +0200, Christoph Hellwig wrote: > We already check for started commands in all callbacks, but we should > also protect against already completed commands. Do this by taking > the checks to common code. > > Signed-off-by: Christoph Hellwig

[PATCH] nbd: set discard granularity properly

2018-05-23 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> For some reason we had discard granularity set to 512 always even when discards were disabled. Fix this by having the default be 0, and then if we turn it on set the discard granularity to the blocksize. Signed-off-by: Josef Bacik <jba...@fb.com&

Re: [PATCH 2/2] nbd: don't start req until after the dead connection logic

2018-05-17 Thread Josef Bacik
On Thu, May 17, 2018 at 06:21:40PM +, Bart Van Assche wrote: > On Thu, 2017-10-19 at 16:21 -0400, Josef Bacik wrote: > > + blk_mq_start_request(req); > > if (unlikely(nsock->pending && nsock->pending != req)) { > > blk_mq_requeue_request(

[PATCH 3/7] nbd: update size when connected

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> I messed up changing the size of an NBD device while it was connected by not actually updating the device or doing the uevent. Fix this by updating everything if we're connected and we change the size. cc: sta...@vger.kernel.org Fixes: 639812a ("nbd

[PATCH 1/7] block: fix MAINTAINERS email for nbd

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> I've been missing stuff because it's been going into my work email which is a black hole. Update to the email I actually use so I stop missing patches and bug reports. Signed-off-by: Josef Bacik <jba...@fb.com> --- MAINTAINERS | 2 +- 1 fil

[PATCH 6/7] nbd: fix how we set bd_invalidated

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> bd_invalidated is kind of a pain wrt partitions as it really only triggers the partition rescan if it is set after bd_ops->open() runs, so setting it when we reset the device isn't useful. We also sporadically would still have partitions left ove

[PATCH 4/7] nbd: use bd_set_size when updating disk size

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> When we stopped relying on the bdev everywhere I broke updating the block device size on the fly, which ceph relies on. We can't just do set_capacity, we also have to do bd_set_size so things like parted will notice the device size change. Fixes: 29eaadc

[PATCH 5/7] nbd: clear_sock on netlink disconnect

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> This is what the ioctl based nbd disconnect does as well. Without this the device will just sit there and wait for the connection to go away (or IO to occur) before the device gets torn down. Instead clear everything up on our end so the configuration goe

[PATCH 2/7] nbd: fix nbd device deletion

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> This fixes a use after free bug, we shouldn't be doing disk->queue right after we do del_gendisk(disk). Save the queue and do the cleanup after the del_gendisk. Fixes: c6a4759ea0c9 ("nbd: add device refcounting") cc: sta...@vger.kernel.org S

[PATCH 7/7] nbd: call nbd_bdev_reset instead of bd_set_size on disconnect

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> We need to make sure we don't just set the size of the bdev to 0 while it's being used by a file system. We have the appropriate check in nbd_bdev_reset, simply use that helper instead. Signed-off-by: Josef Bacik <jba...@fb.com> --- drivers/blo

Re: [PATCH 1/5] block: fix MAINTAINERS email for nbd

2018-05-16 Thread Josef Bacik
On Wed, May 16, 2018 at 02:36:01PM -0400, Josef Bacik wrote: > From: Josef Bacik <jba...@fb.com> > > I've been missing stuff because it's been going into my work email which > is a black hole. Update to the email I actually use so I stop missing > patches and bug reports. &

[PATCH 4/5] nbd: fix how we set bd_invalidated

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> bd_invalidated is kind of a pain wrt partitions as it really only triggers the partition rescan if it is set after bd_ops->open() runs, so setting it when we reset the device isn't useful. We also sporadically would still have partitions left ove

[PATCH 5/5] nbd: call nbd_bdev_reset instead of bd_set_size on disconnect

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> We need to make sure we don't just set the size of the bdev to 0 while it's being used by a file system. We have the appropriate check in nbd_bdev_reset, simply use that helper instead. Signed-off-by: Josef Bacik <jba...@fb.com> --- drivers/blo

[PATCH 1/5] block: fix MAINTAINERS email for nbd

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> I've been missing stuff because it's been going into my work email which is a black hole. Update to the email I actually use so I stop missing patches and bug reports. Signed-off-by: Josef Bacik <jba...@fb.com> --- MAINTAINERS | 2 +- 1 fil

[PATCH 2/5] nbd: do queue cleanup after del_gendisk

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> Apparently del_gendisk is actually supposed to happen first to cleanup the sysfs stuff. Signed-off-by: Josef Bacik <jba...@fb.com> --- drivers/block/nbd.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/block/nbd

[PATCH 3/5] nbd: clear_sock on netlink disconnect

2018-05-16 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> This is what the ioctl based nbd disconnect does as well. Without this the device will just sit there and wait for the connection to go away (or IO to occur) before the device gets torn down. Instead clear everything up on our end so the configuration goe

Re: [PATCH] nbd: do not update block size if file system is mounted

2018-04-13 Thread Josef Bacik
Yeah sorry I screwed that up again. I’m wondering if we can just drop this altogether and leave the zero setting in the config put that we already have. Does doing that fix it for you? Thanks, Josef Sent from my iPhone > On Apr 13, 2018, at 10:26 AM, Michael Tretter

Re: [PATCH 1/3] nbd: del_gendisk after we cleanup the queue

2018-04-13 Thread Josef Bacik
On Fri, Apr 13, 2018 at 04:16:18PM +, Bart Van Assche wrote: > On Fri, 2018-04-13 at 12:03 -0400, Josef Bacik wrote: > > This fixes a use after free bug, we need to do the del_gendisk after we > > cleanup the queue on the device. > > Hello Josef, > > Which use-aft

[PATCH 3/3] nbd: use bd_set_size when updating disk size

2018-04-13 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> When we stopped relying on the bdev everywhere I broke updating the block device size on the fly, which ceph relies on. We can't just do set_capacity, we also have to do bd_set_size so things like parted will notice the device size change. Fixes: 29eaadc

[PATCH 1/3] nbd: del_gendisk after we cleanup the queue

2018-04-13 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> This fixes a use after free bug, we need to do the del_gendisk after we cleanup the queue on the device. Fixes: c6a4759ea0c9 ("nbd: add device refcounting") cc: sta...@vger.kernel.org Signed-off-by: Josef Bacik <jba...@fb.com> --- drivers

[PATCH 2/3] nbd: update size when connected

2018-04-13 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> I messed up changing the size of an NBD device while it was connected by not actually updating the device or doing the uevent. Fix this by updating everything if we're connected and we change the size. cc: sta...@vger.kernel.org Fixes: 639812a ("nbd

[PATCH] nbd: update size when connected

2018-03-12 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> I messed up changing the size of an NBD device while it was connected by not actually updating the device or doing the uevent. Fix this by updating everything if we're connected and we change the size. cc: sta...@vger.kernel.org Fixes: 639812a ("nbd

[PATCH] nbd: fix bdev invalidation

2017-11-07 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> We do the bdev invalidation sort of haphazardly throughout nbd which has resulted in weirdness like partitions not showing up when doing netlink connects, or they not disappearing properly in the ioctl case. Fix this by making the invalidation of the devic

[PATCH 1/2][RESEND] nbd: wait uninterruptible for the dead timeout

2017-11-06 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> If we have a pending signal or the user kills their application then it'll bring down the whole device, which is less than awesome. Instead wait uninterruptible for the dead timeout so we're sure we gave it our best shot. Fixes: 560bc4b39952 ("nbd:

[PATCH 2/2][RESEND] nbd: don't start req until after the dead connection logic

2017-11-06 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> We can end up sleeping for a while waiting for the dead timeout, which means we could get the per request timer to fire. We did handle this case, but if the dead timeout happened right after we submitted we'd either tear down the connection or possibly r

[PATCH] nbd: handle interrupted sendmsg with a sndtimeo set

2017-10-24 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> If you do not set sk_sndtimeo you will get -ERESTARTSYS if there is a pending signal when you enter sendmsg, which we handle properly. However if you set a timeout for your commands we'll set sk_sndtimeo to that timeout, which means that sendmsg will

[PATCH 2/2] nbd: don't start req until after the dead connection logic

2017-10-19 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> We can end up sleeping for a while waiting for the dead timeout, which means we could get the per request timer to fire. We did handle this case, but if the dead timeout happened right after we submitted we'd either tear down the connection or possibly r

[PATCH 1/2] nbd: wait uninterruptible for the dead timeout

2017-10-19 Thread Josef Bacik
From: Josef Bacik <jba...@fb.com> If we have a pending signal or the user kills their application then it'll bring down the whole device, which is less than awesome. Instead wait uninterruptible for the dead timeout so we're sure we gave it our best shot. Fixes: 560bc4b39952 ("nbd:

Re: [ANNOUNCE] fsperf: a simple fs/block performance testing framework

2017-10-09 Thread Josef Bacik
On Tue, Oct 10, 2017 at 08:09:20AM +1100, Dave Chinner wrote: > On Mon, Oct 09, 2017 at 09:00:51AM -0400, Josef Bacik wrote: > > On Mon, Oct 09, 2017 at 04:17:31PM +1100, Dave Chinner wrote: > > > On Sun, Oct 08, 2017 at 10:25:10PM -0400, Josef Bacik wrote: > > > > &g

[PATCH] nbd: don't set the device size until we're connected

2017-10-09 Thread Josef Bacik
the whole time we're setting things up, but we don't do that for the ioctl path. This fixes the problem. Cc: sta...@vger.kernel.org Fixes: 29eaadc ("nbd: stop using the bdev everywhere") Signed-off-by: Josef Bacik <jba...@fb.com> --- drivers/block/nbd.c | 2 +- 1 file changed, 1

Re: [ANNOUNCE] fsperf: a simple fs/block performance testing framework

2017-10-09 Thread Josef Bacik
On Mon, Oct 09, 2017 at 04:17:31PM +1100, Dave Chinner wrote: > On Sun, Oct 08, 2017 at 10:25:10PM -0400, Josef Bacik wrote: > > On Mon, Oct 09, 2017 at 11:51:37AM +1100, Dave Chinner wrote: > > > On Fri, Oct 06, 2017 at 05:09:57PM -0400, Josef Bacik wrote: > > > &g

Re: [ANNOUNCE] fsperf: a simple fs/block performance testing framework

2017-10-09 Thread Josef Bacik
On Sun, Oct 08, 2017 at 11:43:35PM -0400, Theodore Ts'o wrote: > On Sun, Oct 08, 2017 at 10:25:10PM -0400, Josef Bacik wrote: > > > > Probably should have led with that shouldn't I have? There's nothing > > keeping me > > from doing it, but I didn't want to try and

Re: [ANNOUNCE] fsperf: a simple fs/block performance testing framework

2017-10-08 Thread Josef Bacik
On Mon, Oct 09, 2017 at 11:51:37AM +1100, Dave Chinner wrote: > On Fri, Oct 06, 2017 at 05:09:57PM -0400, Josef Bacik wrote: > > Hello, > > > > One thing that comes up a lot every LSF is the fact that we have no general > > way > > that we do performance testi

[ANNOUNCE] fsperf: a simple fs/block performance testing framework

2017-10-06 Thread Josef Bacik
Hello, One thing that comes up a lot every LSF is the fact that we have no general way that we do performance testing. Every fs developer has a set of scripts or things that they run with varying degrees of consistency, but nothing central that we all use. I for one am getting tired of finding

Re: [PATCH] nbd: ignore non-nbd ioctl's

2017-09-20 Thread Josef Bacik
On Fri, May 05, 2017 at 10:25:18PM -0400, Josef Bacik wrote: > In testing we noticed that nbd would spew if you ran a fio job against > the raw device itself. This is because fio calls a block device > specific ioctl, however the block layer will first pass this back to the > driver i

Re: [PATCH V2] block/ndb: add WQ_UNBOUND to the knbd-recv workqueue

2017-09-18 Thread Josef Bacik
_MEM_RECLAIM | WQ_HIGHPRI | > + WQ_UNBOUND, > + 0); This can go on the line above. You can add Reviewed-by: Josef Bacik <jba...@fb.com> once you've made that adjustment. Thanks, Josef

Re: [Nbd] [PATCH 1/3] nbd: allow multiple disconnects to be sent

2017-07-24 Thread Josef Bacik
On Mon, Jul 24, 2017 at 10:08:21PM +0200, Wouter Verhelst wrote: > On Fri, Jul 21, 2017 at 10:48:13AM -0400, jo...@toxicpanda.com wrote: > > From: Josef Bacik <jba...@fb.com> > > > > There's no reason to limit ourselves to one disconnect message per > > socke

Re: nbd drops connection on most writes

2017-07-21 Thread Josef Bacik
Oh shit the default timeout is 0 if you don't set it in the client. Use the timeout option with nbd client and it should fix it for you. I'll send something up to make this a sane default. Thanks, Josef Sent from my iPhone > On Jul 21, 2017, at 8:15 AM, Adam Borowski

Re: [PATCH] nbd: add FUA op support

2017-05-30 Thread Josef Bacik
> Signed-off-by: Shaun McDowell <shaunjmcdow...@gmail.com> Looks good to me, you can add Reviewed-by: Josef Bacik <jba...@fb.com> Thanks, Josef

Re: [PATCH v2 2/2] nbd: don't leak nbd_config

2017-05-30 Thread Josef Bacik
On Tue, May 23, 2017 at 05:49:55PM +0200, Ilya Dryomov wrote: > nbd_config is allocated in nbd_alloc_config(), but never freed. > > Fixes: 5ea8d10802ec ("nbd: separate out the config information") > Signed-off-by: Ilya Dryomov <idryo...@gmail.com> Reviewed-by: Josef B

Re: [PATCH v2 1/2] nbd: nbd_reset() call in nbd_dev_add() is redundant

2017-05-30 Thread Josef Bacik
On Tue, May 23, 2017 at 05:49:54PM +0200, Ilya Dryomov wrote: > There is nothing to clear -- nbd_device has just been allocated. > Fold nbd_reset() into its other caller, nbd_config_put(). > > Signed-off-by: Ilya Dryomov <idryo...@gmail.com> Reviewed-by: Josef Bacik <j

Re: [PATCH] nbd: don't leak nbd_config

2017-05-23 Thread Josef Bacik
rivers/block/nbd.c | 1 + > 1 file changed, 1 insertion(+) > Oops, thanks Ilya Reviewed-by: Josef Bacik <jba...@fb.com> Josef

Re: [PATCH] block: nbd: fix double free

2017-04-28 Thread Josef Bacik
Yeah I found and fixed it already, thanks, Josef On 4/28/17, 11:27 AM, "Ming Lei" <ming@redhat.com> wrote: On Fri, Apr 28, 2017 at 01:00:30PM +0000, Josef Bacik wrote: > We should have 2 references on the device at this point, did you see a “nbd: > possibly leaking a

[PATCH] nbd: fix use after free on module unload

2017-04-28 Thread Josef Bacik
ing@redhat.com> Signed-off-by: Josef Bacik <jba...@fb.com> --- drivers/block/nbd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 76e5f8f..9a6d34e 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -20

Re: [PATCH] block: nbd: fix double free

2017-04-28 Thread Josef Bacik
b fb fb fb fb fb fb ^ 88024ca53a00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb 88024ca53a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb == Fixes: c6a4759ea0c9(nbd: add device refcounting) Cc: Josef B

[PATCH] nbd: set the max segments to USHRT_MAX

2017-04-20 Thread Josef Bacik
I lack the basic understanding of what segments mean, so we were being limited to 512kib requests even with higher max_sectors sizes set. Setting the maximum number of segments to unlimited allows us to actually have arbitrarily large IO's go through NBD. Signed-off-by: Josef Bacik <jba...@fb.

[PATCH] nbd: set the max segment size to UINT_MAX

2017-04-18 Thread Josef Bacik
NBD doesn't care about limiting the segment size, let the user push the largest bio's they want. This allows us to control the request size solely through max_sectors_kb. Signed-off-by: Josef Bacik <jba...@fb.com> --- drivers/block/nbd.c | 1 + 1 file changed, 1 insertion(+) diff

Re: [PATCH] nbd: set the max segment size to UINT_MAX

2017-04-17 Thread Josef Bacik
> On Apr 17, 2017, at 11:59 AM, Jens Axboe <ax...@fb.com> wrote: > > On 04/17/2017 09:57 AM, Jens Axboe wrote: >> On 04/17/2017 09:55 AM, Jens Axboe wrote: >>> On 04/17/2017 07:44 AM, Josef Bacik wrote: >>>> NBD doesn't care about limiting the segmen

[PATCH] nbd: set the max segment size to UINT_MAX

2017-04-17 Thread Josef Bacik
NBD doesn't care about limiting the segment size, let the user push the largest bio's they want. This allows us to control the request size solely through max_sectors_kb. Signed-off-by: Josef Bacik <jba...@fb.com> --- drivers/block/nbd.c | 2 ++ 1 file changed, 2 insertions(+) diff

Re: [PATCH 14/25] nbd: don't use req->errors

2017-04-06 Thread Josef Bacik
> On Apr 6, 2017, at 11:39 AM, Christoph Hellwig <h...@lst.de> wrote: > > Add a nbd-specific field instead. > > Signed-off-by: Christoph Hellwig <h...@lst.de> This is fine with me, you can add, Reviewed-by: Josef Bacik <jba...@fb.com> Thanks, Josef

Re: [PATCH 00/12] nbd: Netlink interface and path failure enhancements

2017-04-06 Thread Josef Bacik
> On Apr 6, 2017, at 5:01 PM, Josef Bacik <jo...@toxicpanda.com> wrote: > > This patchset adds a new netlink configuration interface to NBD as well as a > bunch of enhancments around path failures. The patches provide the following > enhancemnts to NBD > > - Netl

[PATCH 11/12] nbd: add device refcounting

2017-04-06 Thread Josef Bacik
In order to support deleting the device on disconnect we need to refcount the actual nbd_device struct. So add the refcounting framework and change how we free the normal devices at rmmod time so we can catch reference leaks. Signed-off-by: Josef Bacik <jba...@fb.com> --- drivers/block

  1   2   >