diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-07-25 13:29:12 +0200 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 18:53:19 +0200 |
commit | 94eac5e62364df4e605e451218ee6024a7ba664f (patch) | |
tree | 5e4b7d85361ad20821ba3371acc1536262846f22 /tools | |
parent | writeback: harmonize writeback threads naming (diff) | |
download | linux-94eac5e62364df4e605e451218ee6024a7ba664f.tar.xz linux-94eac5e62364df4e605e451218ee6024a7ba664f.zip |
writeback: fix possible race when creating bdi threads
This patch fixes a very unlikely race condition on the bdi forker thread error
path: when bdi thread creation fails, 'bdi->wb.task' may contain the error code
for a short period of time. If at the same time someone submits a work to this
bdi, we can end up with an oops 'bdi_queue_work()' while executing
'wake_up_process(wb->task)'.
This patch fixes the issue by introducing a temporary variable 'task' and
storing the possible error code there, so that 'wb->task' would never take
erroneous values.
Note, this race is very unlikely and I never hit it, so it is theoretical, but
nevertheless worth fixing.
This patch also merges 2 comments which were previously separate.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions