|
@@ -349,10 +349,13 @@ int btrfs_dec_test_first_ordered_pending(struct inode *inode,
|
|
if (!uptodate)
|
|
if (!uptodate)
|
|
set_bit(BTRFS_ORDERED_IOERR, &entry->flags);
|
|
set_bit(BTRFS_ORDERED_IOERR, &entry->flags);
|
|
|
|
|
|
- if (entry->bytes_left == 0)
|
|
|
|
|
|
+ if (entry->bytes_left == 0) {
|
|
ret = test_and_set_bit(BTRFS_ORDERED_IO_DONE, &entry->flags);
|
|
ret = test_and_set_bit(BTRFS_ORDERED_IO_DONE, &entry->flags);
|
|
- else
|
|
|
|
|
|
+ if (waitqueue_active(&entry->wait))
|
|
|
|
+ wake_up(&entry->wait);
|
|
|
|
+ } else {
|
|
ret = 1;
|
|
ret = 1;
|
|
|
|
+ }
|
|
out:
|
|
out:
|
|
if (!ret && cached && entry) {
|
|
if (!ret && cached && entry) {
|
|
*cached = entry;
|
|
*cached = entry;
|
|
@@ -410,10 +413,13 @@ have_entry:
|
|
if (!uptodate)
|
|
if (!uptodate)
|
|
set_bit(BTRFS_ORDERED_IOERR, &entry->flags);
|
|
set_bit(BTRFS_ORDERED_IOERR, &entry->flags);
|
|
|
|
|
|
- if (entry->bytes_left == 0)
|
|
|
|
|
|
+ if (entry->bytes_left == 0) {
|
|
ret = test_and_set_bit(BTRFS_ORDERED_IO_DONE, &entry->flags);
|
|
ret = test_and_set_bit(BTRFS_ORDERED_IO_DONE, &entry->flags);
|
|
- else
|
|
|
|
|
|
+ if (waitqueue_active(&entry->wait))
|
|
|
|
+ wake_up(&entry->wait);
|
|
|
|
+ } else {
|
|
ret = 1;
|
|
ret = 1;
|
|
|
|
+ }
|
|
out:
|
|
out:
|
|
if (!ret && cached && entry) {
|
|
if (!ret && cached && entry) {
|
|
*cached = entry;
|
|
*cached = entry;
|