diff options
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index e6585b9ff45a..1e3725e51df1 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -339,6 +339,7 @@ static void nfs_direct_read_schedule(struct nfs_direct_req *dreq) | |||
339 | if (count < rsize) | 339 | if (count < rsize) |
340 | bytes = count; | 340 | bytes = count; |
341 | 341 | ||
342 | BUG_ON(list_empty(list)); | ||
342 | data = list_entry(list->next, struct nfs_read_data, pages); | 343 | data = list_entry(list->next, struct nfs_read_data, pages); |
343 | list_del_init(&data->pages); | 344 | list_del_init(&data->pages); |
344 | 345 | ||
@@ -378,6 +379,7 @@ static void nfs_direct_read_schedule(struct nfs_direct_req *dreq) | |||
378 | 379 | ||
379 | count -= bytes; | 380 | count -= bytes; |
380 | } while (count != 0); | 381 | } while (count != 0); |
382 | BUG_ON(!list_empty(list)); | ||
381 | } | 383 | } |
382 | 384 | ||
383 | static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos, struct page **pages, unsigned int nr_pages) | 385 | static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos, struct page **pages, unsigned int nr_pages) |
@@ -657,6 +659,7 @@ static void nfs_direct_write_schedule(struct nfs_direct_req *dreq, int sync) | |||
657 | if (count < wsize) | 659 | if (count < wsize) |
658 | bytes = count; | 660 | bytes = count; |
659 | 661 | ||
662 | BUG_ON(list_empty(list)); | ||
660 | data = list_entry(list->next, struct nfs_write_data, pages); | 663 | data = list_entry(list->next, struct nfs_write_data, pages); |
661 | list_move_tail(&data->pages, &dreq->rewrite_list); | 664 | list_move_tail(&data->pages, &dreq->rewrite_list); |
662 | 665 | ||
@@ -697,6 +700,7 @@ static void nfs_direct_write_schedule(struct nfs_direct_req *dreq, int sync) | |||
697 | 700 | ||
698 | count -= bytes; | 701 | count -= bytes; |
699 | } while (count != 0); | 702 | } while (count != 0); |
703 | BUG_ON(!list_empty(list)); | ||
700 | } | 704 | } |
701 | 705 | ||
702 | static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos, struct page **pages, int nr_pages) | 706 | static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos, struct page **pages, int nr_pages) |