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 tag 'tytso-for-linus-20111214' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* tag 'tytso-for-linus-20111214' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: handle EOF correctly in ext4_bio_write_page()
ext4: remove a wrong BUG_ON in ext4_ext_convert_to_initialized
ext4: correctly handle pages w/o buffers in ext4_discard_partial_buffers()
ext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize
ext4: avoid hangs in ext4_da_should_update_i_disksize()
ext4: display the correct mount option in /proc/mounts for [no]init_itable
ext4: Fix crash due to getting bogus eh_depth value on big-endian systems
ext4: fix ext4_end_io_dio() racing against fsync()

.. using the new signed tag merge of git that now verifies the gpg
signature automatically. Yay. The branchname was just 'dev', which is
prettier. I'll tell Ted to use nicer tag names for future cases.

+31 -55
+1 -2
fs/ext4/extents.c
··· 1095 1095 le32_to_cpu(EXT_FIRST_INDEX(neh)->ei_block), 1096 1096 ext4_idx_pblock(EXT_FIRST_INDEX(neh))); 1097 1097 1098 - neh->eh_depth = cpu_to_le16(neh->eh_depth + 1); 1098 + neh->eh_depth = cpu_to_le16(le16_to_cpu(neh->eh_depth) + 1); 1099 1099 ext4_mark_inode_dirty(handle, inode); 1100 1100 out: 1101 1101 brelse(bh); ··· 2955 2955 /* Pre-conditions */ 2956 2956 BUG_ON(!ext4_ext_is_uninitialized(ex)); 2957 2957 BUG_ON(!in_range(map->m_lblk, ee_block, ee_len)); 2958 - BUG_ON(map->m_lblk + map->m_len > ee_block + ee_len); 2959 2958 2960 2959 /* 2961 2960 * Attempt to transfer newly initialized blocks from the currently
+10 -44
fs/ext4/inode.c
··· 1339 1339 clear_buffer_unwritten(bh); 1340 1340 } 1341 1341 1342 - /* skip page if block allocation undone */ 1343 - if (buffer_delay(bh) || buffer_unwritten(bh)) 1342 + /* 1343 + * skip page if block allocation undone and 1344 + * block is dirty 1345 + */ 1346 + if (ext4_bh_delay_or_unwritten(NULL, bh)) 1344 1347 skip_page = 1; 1345 1348 bh = bh->b_this_page; 1346 1349 block_start += bh->b_size; ··· 2390 2387 pgoff_t index; 2391 2388 struct inode *inode = mapping->host; 2392 2389 handle_t *handle; 2393 - loff_t page_len; 2394 2390 2395 2391 index = pos >> PAGE_CACHE_SHIFT; 2396 2392 ··· 2436 2434 */ 2437 2435 if (pos + len > inode->i_size) 2438 2436 ext4_truncate_failed_write(inode); 2439 - } else { 2440 - page_len = pos & (PAGE_CACHE_SIZE - 1); 2441 - if (page_len > 0) { 2442 - ret = ext4_discard_partial_page_buffers_no_lock(handle, 2443 - inode, page, pos - page_len, page_len, 2444 - EXT4_DISCARD_PARTIAL_PG_ZERO_UNMAPPED); 2445 - } 2446 2437 } 2447 2438 2448 2439 if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) ··· 2478 2483 loff_t new_i_size; 2479 2484 unsigned long start, end; 2480 2485 int write_mode = (int)(unsigned long)fsdata; 2481 - loff_t page_len; 2482 2486 2483 2487 if (write_mode == FALL_BACK_TO_NONDELALLOC) { 2484 2488 if (ext4_should_order_data(inode)) { ··· 2502 2508 */ 2503 2509 2504 2510 new_i_size = pos + copied; 2505 - if (new_i_size > EXT4_I(inode)->i_disksize) { 2511 + if (copied && new_i_size > EXT4_I(inode)->i_disksize) { 2506 2512 if (ext4_da_should_update_i_disksize(page, end)) { 2507 2513 down_write(&EXT4_I(inode)->i_data_sem); 2508 2514 if (new_i_size > EXT4_I(inode)->i_disksize) { ··· 2526 2532 } 2527 2533 ret2 = generic_write_end(file, mapping, pos, len, copied, 2528 2534 page, fsdata); 2529 - 2530 - page_len = PAGE_CACHE_SIZE - 2531 - ((pos + copied - 1) & (PAGE_CACHE_SIZE - 1)); 2532 - 2533 - if (page_len > 0) { 2534 - ret = ext4_discard_partial_page_buffers_no_lock(handle, 2535 - inode, page, pos + copied - 1, page_len, 2536 - EXT4_DISCARD_PARTIAL_PG_ZERO_UNMAPPED); 2537 - } 2538 - 2539 2535 copied = ret2; 2540 2536 if (ret2 < 0) 2541 2537 ret = ret2; ··· 2765 2781 iocb->private, io_end->inode->i_ino, iocb, offset, 2766 2782 size); 2767 2783 2784 + iocb->private = NULL; 2785 + 2768 2786 /* if not aio dio with unwritten extents, just free io and return */ 2769 2787 if (!(io_end->flag & EXT4_IO_END_UNWRITTEN)) { 2770 2788 ext4_free_io_end(io_end); 2771 - iocb->private = NULL; 2772 2789 out: 2773 2790 if (is_async) 2774 2791 aio_complete(iocb, ret, 0); ··· 2792 2807 spin_unlock_irqrestore(&ei->i_completed_io_lock, flags); 2793 2808 2794 2809 /* queue the work to convert unwritten extents to written */ 2795 - iocb->private = NULL; 2796 2810 queue_work(wq, &io_end->work); 2797 2811 2798 2812 /* XXX: probably should move into the real I/O completion handler */ ··· 3187 3203 3188 3204 iblock = index << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits); 3189 3205 3190 - if (!page_has_buffers(page)) { 3191 - /* 3192 - * If the range to be discarded covers a partial block 3193 - * we need to get the page buffers. This is because 3194 - * partial blocks cannot be released and the page needs 3195 - * to be updated with the contents of the block before 3196 - * we write the zeros on top of it. 3197 - */ 3198 - if ((from & (blocksize - 1)) || 3199 - ((from + length) & (blocksize - 1))) { 3200 - create_empty_buffers(page, blocksize, 0); 3201 - } else { 3202 - /* 3203 - * If there are no partial blocks, 3204 - * there is nothing to update, 3205 - * so we can return now 3206 - */ 3207 - return 0; 3208 - } 3209 - } 3206 + if (!page_has_buffers(page)) 3207 + create_empty_buffers(page, blocksize, 0); 3210 3208 3211 3209 /* Find the buffer that contains "offset" */ 3212 3210 bh = page_buffers(page);
+12
fs/ext4/page-io.c
··· 385 385 386 386 block_end = block_start + blocksize; 387 387 if (block_start >= len) { 388 + /* 389 + * Comments copied from block_write_full_page_endio: 390 + * 391 + * The page straddles i_size. It must be zeroed out on 392 + * each and every writepage invocation because it may 393 + * be mmapped. "A file is mapped in multiples of the 394 + * page size. For a file that is not a multiple of 395 + * the page size, the remaining memory is zeroed when 396 + * mapped, and writes to that region are not written 397 + * out to the file." 398 + */ 399 + zero_user_segment(page, block_start, block_end); 388 400 clear_buffer_dirty(bh); 389 401 set_buffer_uptodate(bh); 390 402 continue;
+8 -9
fs/ext4/super.c
··· 1155 1155 seq_puts(seq, ",block_validity"); 1156 1156 1157 1157 if (!test_opt(sb, INIT_INODE_TABLE)) 1158 - seq_puts(seq, ",noinit_inode_table"); 1158 + seq_puts(seq, ",noinit_itable"); 1159 1159 else if (sbi->s_li_wait_mult != EXT4_DEF_LI_WAIT_MULT) 1160 - seq_printf(seq, ",init_inode_table=%u", 1160 + seq_printf(seq, ",init_itable=%u", 1161 1161 (unsigned) sbi->s_li_wait_mult); 1162 1162 1163 1163 ext4_show_quota_options(seq, sb); ··· 1333 1333 Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, 1334 1334 Opt_inode_readahead_blks, Opt_journal_ioprio, 1335 1335 Opt_dioread_nolock, Opt_dioread_lock, 1336 - Opt_discard, Opt_nodiscard, 1337 - Opt_init_inode_table, Opt_noinit_inode_table, 1336 + Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable, 1338 1337 }; 1339 1338 1340 1339 static const match_table_t tokens = { ··· 1406 1407 {Opt_dioread_lock, "dioread_lock"}, 1407 1408 {Opt_discard, "discard"}, 1408 1409 {Opt_nodiscard, "nodiscard"}, 1409 - {Opt_init_inode_table, "init_itable=%u"}, 1410 - {Opt_init_inode_table, "init_itable"}, 1411 - {Opt_noinit_inode_table, "noinit_itable"}, 1410 + {Opt_init_itable, "init_itable=%u"}, 1411 + {Opt_init_itable, "init_itable"}, 1412 + {Opt_noinit_itable, "noinit_itable"}, 1412 1413 {Opt_err, NULL}, 1413 1414 }; 1414 1415 ··· 1891 1892 case Opt_dioread_lock: 1892 1893 clear_opt(sb, DIOREAD_NOLOCK); 1893 1894 break; 1894 - case Opt_init_inode_table: 1895 + case Opt_init_itable: 1895 1896 set_opt(sb, INIT_INODE_TABLE); 1896 1897 if (args[0].from) { 1897 1898 if (match_int(&args[0], &option)) ··· 1902 1903 return 0; 1903 1904 sbi->s_li_wait_mult = option; 1904 1905 break; 1905 - case Opt_noinit_inode_table: 1906 + case Opt_noinit_itable: 1906 1907 clear_opt(sb, INIT_INODE_TABLE); 1907 1908 break; 1908 1909 default: