Patch "loop: fix LO_FLAGS_PARTSCAN hang" has been added to the 4.10-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
loop: fix LO_FLAGS_PARTSCAN hang
to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
loop-fix-lo_flags_partscan-hang.patch
and it can be found in the queue-4.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
e02898b423802b1f3a3aaa7f16e896da069ba8f7Mon Sep 17 00:00:00 2001
From: Omar Sandoval <[email protected]>
Date: Wed, 1 Mar 2017 10:42:38 -0800
Subject: loop: fix LO_FLAGS_PARTSCAN hang
From: Omar Sandoval <[email protected]>
commit e02898b423802b1f3a3aaa7f16e896da069ba8f7 upstream.
loop_reread_partitions() needs to do I/O, but we just froze the queue, so we end up waiting forever. This can easily be reproduced with losetup -P. Fix it by moving the reread to after we unfreeze the queue.
--- drivers/block/loop.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/block/loop.c +8 -7
@@ -1142,13 +1142,6 @@ loop_set_status(struct loop_device *lo, (info->lo_flags & LO_FLAGS_AUTOCLEAR)) lo->lo_flags ^= LO_FLAGS_AUTOCLEAR; -if ((info->lo_flags &LO_FLAGS_PARTSCAN ) && - !(lo->lo_flags &LO_FLAGS_PARTSCAN )) { - lo->lo_flags |=LO_FLAGS_PARTSCAN ; - lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN ; -loop_reread_partitions (lo, lo->lo_device); - } - lo->lo_encrypt_key_size = info->lo_encrypt_key_size; lo->lo_init[0 ] = info->lo_init[0 ]; lo->lo_init[1 ] = info->lo_init[1 ];
@@ -1163,6 +1156,14 @@ loop_set_status(struct loop_device *lo, exit:blk_mq_unfreeze_queue (lo->lo_queue); + +if (!err && (info->lo_flags &LO_FLAGS_PARTSCAN ) && + !(lo->lo_flags &LO_FLAGS_PARTSCAN )) { + lo->lo_flags |=LO_FLAGS_PARTSCAN ; + lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN ; +loop_reread_partitions (lo, lo->lo_device); + } +return err; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.10/loop-fix-lo_flags_partscan-hang.patch
Quoted 29 lines · On 03/08/2017 08:39 AM, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
loop: fix
LO_FLAGS_PARTSCANhangto the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
loop-fix-lo_flags_partscan-hang.patch
and it can be found in the queue-4.10 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From
e02898b423802b1f3a3aaa7f16e896da069ba8f7Mon Sep 17 00:00:00 2001
From: Omar Sandoval <[email protected]>
Date: Wed, 1 Mar 2017 10:42:38 -0800
Subject: loop: fixLO_FLAGS_PARTSCANhangFrom: Omar Sandoval <[email protected]>
commit
e02898b423802b1f3a3aaa7f16e896da069ba8f7upstream.
loop_reread_partitions()needs to do I/O, but we just froze the queue, so we end up waiting forever. This can easily be reproduced with losetup -P. Fix it by moving the reread to after we unfreeze the queue.
Quoted 6 lines
Fixes ecdd09597a57 ("block/loop: fix race between I/O and set_status")Reported-by Tejun Heo <[email protected]>Signed-off-by Omar Sandoval <[email protected]>Reviewed-by Ming Lei <[email protected]>Signed-off-by Jens Axboe <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Why is this being added to a bunch of trees that don't have the commit that it fixes? It should not go into any of these.
Signature · 1 line
Jens Axboe
Quoted 37 lines · Jens Axboe
Quoted 29 lines · On 03/08/2017 08:39 AM, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
loop: fix
LO_FLAGS_PARTSCANhangto the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
loop-fix-lo_flags_partscan-hang.patch
and it can be found in the queue-4.10 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From
e02898b423802b1f3a3aaa7f16e896da069ba8f7Mon Sep 17 00:00:00 2001
From: Omar Sandoval <[email protected]>
Date: Wed, 1 Mar 2017 10:42:38 -0800
Subject: loop: fixLO_FLAGS_PARTSCANhangFrom: Omar Sandoval <[email protected]>
commit
e02898b423802b1f3a3aaa7f16e896da069ba8f7upstream.
loop_reread_partitions()needs to do I/O, but we just froze the queue, so we end up waiting forever. This can easily be reproduced with losetup -P. Fix it by moving the reread to after we unfreeze the queue.Quoted 6 lines
Fixes ecdd09597a57 ("block/loop: fix race between I/O and set_status")Reported-by Tejun Heo <[email protected]>Signed-off-by Omar Sandoval <[email protected]>Reviewed-by Ming Lei <[email protected]>Signed-off-by Jens Axboe <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 3 lines
Why is this being added to a bunch of trees that don't have the commit that it fixes? It should not go into any of these.
The commit it fixes was marked for stable, which is why I also marked this one for stable. And it looks like that commit is also queued up for these stable releases:
http://git.kernel.org/cgit/linux/kernel/git/stable/stable-queue.git/tree/queue-4.10/block-loop-fix-race-between-i-o-and-set_status.patch
http://git.kernel.org/cgit/linux/kernel/git/stable/stable-queue.git/tree/queue-4.9/block-loop-fix-race-between-i-o-and-set_status.patch
http://git.kernel.org/cgit/linux/kernel/git/stable/stable-queue.git/tree/queue-4.4/block-loop-fix-race-between-i-o-and-set_status.patch
So it should be okay.
Quoted 46 lines · Omar Sandoval
Quoted 37 lines · Jens Axboe
Quoted 29 lines · On 03/08/2017 08:39 AM, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
loop: fix
LO_FLAGS_PARTSCANhangto the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
loop-fix-lo_flags_partscan-hang.patch
and it can be found in the queue-4.10 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From
e02898b423802b1f3a3aaa7f16e896da069ba8f7Mon Sep 17 00:00:00 2001
From: Omar Sandoval <[email protected]>
Date: Wed, 1 Mar 2017 10:42:38 -0800
Subject: loop: fixLO_FLAGS_PARTSCANhangFrom: Omar Sandoval <[email protected]>
commit
e02898b423802b1f3a3aaa7f16e896da069ba8f7upstream.
loop_reread_partitions()needs to do I/O, but we just froze the queue, so we end up waiting forever. This can easily be reproduced with losetup -P. Fix it by moving the reread to after we unfreeze the queue.Quoted 6 lines
Fixes ecdd09597a57 ("block/loop: fix race between I/O and set_status")Reported-by Tejun Heo <[email protected]>Signed-off-by Omar Sandoval <[email protected]>Reviewed-by Ming Lei <[email protected]>Signed-off-by Jens Axboe <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Quoted 3 lines
Why is this being added to a bunch of trees that don't have the commit that it fixes? It should not go into any of these.
The commit it fixes was marked for stable, which is why I also marked this one for stable. And it looks like that commit is also queued up for these stable releases:
Quoted 5 lines
http://git.kernel.org/cgit/linux/kernel/git/stable/stable-queue.git/tree/queue-4.10/block-loop-fix-race-between-i-o-and-set_status.patch
http://git.kernel.org/cgit/linux/kernel/git/stable/stable-queue.git/tree/queue-4.9/block-loop-fix-race-between-i-o-and-set_status.patch
http://git.kernel.org/cgit/linux/kernel/git/stable/stable-queue.git/tree/queue-4.4/block-loop-fix-race-between-i-o-and-set_status.patchSo it should be okay.
Ah yes, that makes sense, I missed that.
Signature · 1 line
Jens Axboe
Greg KH
maintainerQuoted 37 lines · Jens Axboe
Quoted 29 lines · On 03/08/2017 08:39 AM, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
loop: fix
LO_FLAGS_PARTSCANhangto the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
loop-fix-lo_flags_partscan-hang.patch
and it can be found in the queue-4.10 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From
e02898b423802b1f3a3aaa7f16e896da069ba8f7Mon Sep 17 00:00:00 2001
From: Omar Sandoval <[email protected]>
Date: Wed, 1 Mar 2017 10:42:38 -0800
Subject: loop: fixLO_FLAGS_PARTSCANhangFrom: Omar Sandoval <[email protected]>
commit
e02898b423802b1f3a3aaa7f16e896da069ba8f7upstream.
loop_reread_partitions()needs to do I/O, but we just froze the queue, so we end up waiting forever. This can easily be reproduced with losetup -P. Fix it by moving the reread to after we unfreeze the queue.Quoted 6 lines
Fixes ecdd09597a57 ("block/loop: fix race between I/O and set_status")Reported-by Tejun Heo <[email protected]>Signed-off-by Omar Sandoval <[email protected]>Reviewed-by Ming Lei <[email protected]>Signed-off-by Jens Axboe <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 2 lines
Why is this being added to a bunch of trees that don't have the commit that it fixes? It should not go into any of these.
Because the commit this fixes just got added to all of those trees. Is that not the correct thing needed here?
thanks,
greg k-h
Quoted 38 lines · Greg KH
Quoted 37 lines · Jens Axboe
Quoted 35 lines · On 03/08/2017 08:39 AM, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
loop: fix
LO_FLAGS_PARTSCANhangto the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
loop-fix-lo_flags_partscan-hang.patch
and it can be found in the queue-4.10 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From
e02898b423802b1f3a3aaa7f16e896da069ba8f7Mon Sep 17 00:00:00 2001
From: Omar Sandoval <[email protected]>
Date: Wed, 1 Mar 2017 10:42:38 -0800
Subject: loop: fixLO_FLAGS_PARTSCANhangFrom: Omar Sandoval <[email protected]>
commit
e02898b423802b1f3a3aaa7f16e896da069ba8f7upstream.
loop_reread_partitions()needs to do I/O, but we just froze the queue, so we end up waiting forever. This can easily be reproduced with losetup -P. Fix it by moving the reread to after we unfreeze the queue.Fixes ecdd09597a57 ("block/loop: fix race between I/O and set_status")Reported-by Tejun Heo <[email protected]>Signed-off-by Omar Sandoval <[email protected]>Reviewed-by Ming Lei <[email protected]>Signed-off-by Jens Axboe <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 5 lines
Quoted 2 lines
Why is this being added to a bunch of trees that don't have the commit that it fixes? It should not go into any of these.
Because the commit this fixes just got added to all of those trees. Is that not the correct thing needed here?
It is, I forgot/missed that the original commit was marked for stable, which should of course pull this one in as well.
Signature · 1 line
Jens Axboe