]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/direct-io.c
b44: early return in dev->do_ioctl when the device is not up
[linux-2.6-omap-h63xx.git] / fs / direct-io.c
index 0d06097bc995f93cd0074c424cbf24d221b80490..3931e7f1e6bf34a53caad0ced825942b14c18e1b 100644 (file)
@@ -162,6 +162,7 @@ static int dio_refill_pages(struct dio *dio)
        up_read(&current->mm->mmap_sem);
 
        if (ret < 0 && dio->blocks_available && (dio->rw == WRITE)) {
+               struct page *page = ZERO_PAGE(dio->curr_user_address);
                /*
                 * A memory fault, but the filesystem has some outstanding
                 * mapped blocks.  We need to use those blocks up to avoid
@@ -169,7 +170,8 @@ static int dio_refill_pages(struct dio *dio)
                 */
                if (dio->page_errors == 0)
                        dio->page_errors = ret;
-               dio->pages[0] = ZERO_PAGE(dio->curr_user_address);
+               page_cache_get(page);
+               dio->pages[0] = page;
                dio->head = 0;
                dio->tail = 1;
                ret = 0;