Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: flush any pending end_io requests before DIO reads w/dioread_nolock
ext4: fix nomblk_io_submit option so it correctly converts uninit blocks
ext4: Resolve the hang of direct i/o read in handling EXT4_IO_END_UNWRITTEN.
ext4: call ext4_ioend_wait and ext4_flush_completed_IO in ext4_evict_inode
ext4: Fix ext4_should_writeback_data() for no-journal mode

+37 -9
+2 -2
fs/ext4/ext4_jbd2.h
··· 289 289 290 290 static inline int ext4_should_writeback_data(struct inode *inode) 291 291 { 292 - if (!S_ISREG(inode->i_mode)) 293 - return 0; 294 292 if (EXT4_JOURNAL(inode) == NULL) 295 293 return 1; 294 + if (!S_ISREG(inode->i_mode)) 295 + return 0; 296 296 if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA)) 297 297 return 0; 298 298 if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)
+7 -2
fs/ext4/indirect.c
··· 800 800 } 801 801 802 802 retry: 803 - if (rw == READ && ext4_should_dioread_nolock(inode)) 803 + if (rw == READ && ext4_should_dioread_nolock(inode)) { 804 + if (unlikely(!list_empty(&ei->i_completed_io_list))) { 805 + mutex_lock(&inode->i_mutex); 806 + ext4_flush_completed_IO(inode); 807 + mutex_unlock(&inode->i_mutex); 808 + } 804 809 ret = __blockdev_direct_IO(rw, iocb, inode, 805 810 inode->i_sb->s_bdev, iov, 806 811 offset, nr_segs, 807 812 ext4_get_block, NULL, NULL, 0); 808 - else { 813 + } else { 809 814 ret = blockdev_direct_IO(rw, iocb, inode, iov, 810 815 offset, nr_segs, ext4_get_block); 811 816
+24 -2
fs/ext4/inode.c
··· 120 120 int err; 121 121 122 122 trace_ext4_evict_inode(inode); 123 + 124 + mutex_lock(&inode->i_mutex); 125 + ext4_flush_completed_IO(inode); 126 + mutex_unlock(&inode->i_mutex); 127 + ext4_ioend_wait(inode); 128 + 123 129 if (inode->i_nlink) { 124 130 /* 125 131 * When journalling data dirty buffers are tracked only in the ··· 989 983 from = pos & (PAGE_CACHE_SIZE - 1); 990 984 to = from + len; 991 985 986 + BUG_ON(!ext4_handle_valid(handle)); 987 + 992 988 if (copied < len) { 993 989 if (!PageUptodate(page)) 994 990 copied = 0; ··· 1291 1283 else if (test_opt(inode->i_sb, MBLK_IO_SUBMIT)) 1292 1284 err = ext4_bio_write_page(&io_submit, page, 1293 1285 len, mpd->wbc); 1294 - else 1286 + else if (buffer_uninit(page_bufs)) { 1287 + ext4_set_bh_endio(page_bufs, inode); 1288 + err = block_write_full_page_endio(page, 1289 + noalloc_get_block_write, 1290 + mpd->wbc, ext4_end_io_buffer_write); 1291 + } else 1295 1292 err = block_write_full_page(page, 1296 1293 noalloc_get_block_write, mpd->wbc); 1297 1294 ··· 1711 1698 ret = PTR_ERR(handle); 1712 1699 goto out; 1713 1700 } 1701 + 1702 + BUG_ON(!ext4_handle_valid(handle)); 1714 1703 1715 1704 ret = walk_page_buffers(handle, page_bufs, 0, len, NULL, 1716 1705 do_journal_get_write_access); ··· 2683 2668 goto out; 2684 2669 } 2685 2670 2686 - io_end->flag = EXT4_IO_END_UNWRITTEN; 2671 + /* 2672 + * It may be over-defensive here to check EXT4_IO_END_UNWRITTEN now, 2673 + * but being more careful is always safe for the future change. 2674 + */ 2687 2675 inode = io_end->inode; 2676 + if (!(io_end->flag & EXT4_IO_END_UNWRITTEN)) { 2677 + io_end->flag |= EXT4_IO_END_UNWRITTEN; 2678 + atomic_inc(&EXT4_I(inode)->i_aiodio_unwritten); 2679 + } 2688 2680 2689 2681 /* Add the io_end to per-inode completed io list*/ 2690 2682 spin_lock_irqsave(&EXT4_I(inode)->i_completed_io_lock, flags);
+4 -2
fs/ext4/page-io.c
··· 334 334 if ((io_end->num_io_pages >= MAX_IO_PAGES) && 335 335 (io_end->pages[io_end->num_io_pages-1] != io_page)) 336 336 goto submit_and_retry; 337 - if (buffer_uninit(bh)) 338 - io->io_end->flag |= EXT4_IO_END_UNWRITTEN; 337 + if (buffer_uninit(bh) && !(io_end->flag & EXT4_IO_END_UNWRITTEN)) { 338 + io_end->flag |= EXT4_IO_END_UNWRITTEN; 339 + atomic_inc(&EXT4_I(inode)->i_aiodio_unwritten); 340 + } 339 341 io->io_end->size += bh->b_size; 340 342 io->io_next_block++; 341 343 ret = bio_add_page(io->io_bio, bh->b_page, bh->b_size, bh_offset(bh));
-1
fs/ext4/super.c
··· 919 919 920 920 static void ext4_destroy_inode(struct inode *inode) 921 921 { 922 - ext4_ioend_wait(inode); 923 922 if (!list_empty(&(EXT4_I(inode)->i_orphan))) { 924 923 ext4_msg(inode->i_sb, KERN_ERR, 925 924 "Inode %lu (%p): orphan list check failed!",