diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-11-07 12:35:44 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-11-07 12:35:44 -0500 |
commit | af09abfece59aa50bfbf16f6f1f85822554e061f (patch) | |
tree | ca419511219b433a2bf45626814777df8667a19f /arch | |
parent | 4366211ccd050e00674b3276b5ed81981b2d7793 (diff) | |
download | linux-af09abfece59aa50bfbf16f6f1f85822554e061f.tar.bz2 |
Btrfs: make sure compressed bios don't complete too soon
When writing a compressed extent, a number of bios are created that
point to a single struct compressed_bio. At end_io time an atomic counter in
the compressed_bio struct makes sure that all of the bios have finished
before final end_io processing is done.
But when multiple bios are needed to write a compressed extent, the
counter was being incremented after the first bio was sent to submit_bio.
It is possible the bio will complete before the counter is incremented,
making the end_io handler free the compressed_bio struct before
processing is finished.
The fix is to increment the atomic counter before bio submission,
both for compressed reads and writes.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions