Commit d0642c69 authored by Nathan Scott's avatar Nathan Scott

[XFS] Fix a possible bio-leak on I/O submission, in a case where no I/O was required.

SGI Modid: 2.5.x-xfs:slinx:163119a
parent 364c4073
...@@ -1395,7 +1395,6 @@ _pagebuf_ioapply( ...@@ -1395,7 +1395,6 @@ _pagebuf_ioapply(
break; break;
offset = 0; offset = 0;
sector += nbytes >> BBSHIFT; sector += nbytes >> BBSHIFT;
size -= nbytes; size -= nbytes;
total_nr_pages--; total_nr_pages--;
...@@ -1403,15 +1402,11 @@ _pagebuf_ioapply( ...@@ -1403,15 +1402,11 @@ _pagebuf_ioapply(
submit_io: submit_io:
if (likely(bio->bi_size)) { if (likely(bio->bi_size)) {
if (pb->pb_flags & PBF_READ) { submit_bio((pb->pb_flags & PBF_READ) ? READ : WRITE, bio);
submit_bio(READ, bio);
} else {
submit_bio(WRITE, bio);
}
if (size) if (size)
goto next_chunk; goto next_chunk;
} else { } else {
bio_put(bio);
pagebuf_ioerror(pb, EIO); pagebuf_ioerror(pb, EIO);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment