diff options
author | Luis Chamberlain <mcgrof@kernel.org> | 2020-06-05 16:58:36 +0200 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2020-06-29 20:08:02 -0400 |
commit | 157dafb4a734ce030077dce5f01c9e19277ab07c (patch) | |
tree | 0a4ce105257428a4f00bee04c6bb9f40c7c2a660 /drivers/acpi | |
parent | ea4f911f9c1ab2d8a37af68e18f0de2988b89d26 (diff) | |
download | linux-stable-157dafb4a734ce030077dce5f01c9e19277ab07c.tar.gz linux-stable-157dafb4a734ce030077dce5f01c9e19277ab07c.tar.bz2 linux-stable-157dafb4a734ce030077dce5f01c9e19277ab07c.zip |
blktrace: break out of blktrace setup on concurrent calls
[ Upstream commit 1b0b283648163dae2a214ca28ed5a99f62a77319 ]
We use one blktrace per request_queue, that means one per the entire
disk. So we cannot run one blktrace on say /dev/vda and then /dev/vda1,
or just two calls on /dev/vda.
We check for concurrent setup only at the very end of the blktrace setup though.
If we try to run two concurrent blktraces on the same block device the
second one will fail, and the first one seems to go on. However when
one tries to kill the first one one will see things like this:
The kernel will show these:
```
debugfs: File 'dropped' in directory 'nvme1n1' already present!
debugfs: File 'msg' in directory 'nvme1n1' already present!
debugfs: File 'trace0' in directory 'nvme1n1' already present!
``
And userspace just sees this error message for the second call:
```
blktrace /dev/nvme1n1
BLKTRACESETUP(2) /dev/nvme1n1 failed: 5/Input/output error
```
The first userspace process #1 will also claim that the files
were taken underneath their nose as well. The files are taken
away form the first process given that when the second blktrace
fails, it will follow up with a BLKTRACESTOP and BLKTRACETEARDOWN.
This means that even if go-happy process #1 is waiting for blktrace
data, we *have* been asked to take teardown the blktrace.
This can easily be reproduced with break-blktrace [0] run_0005.sh test.
Just break out early if we know we're already going to fail, this will
prevent trying to create the files all over again, which we know still
exist.
[0] https://github.com/mcgrof/break-blktrace
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/acpi')
0 files changed, 0 insertions, 0 deletions