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 'for-linus-v3.10-rc3' of git://oss.sgi.com/xfs/xfs

Pull xfs fixes from Ben Myers:
"Here are fixes for corruption on 512 byte filesystems, a rounding
error, a use-after-free, some flags to fix lockdep reports, and
several fixes related to CRCs. We have a somewhat larger post -rc1
queue than usual due to fixes related to the CRC feature we merged for
3.10:

- Fix for corruption with FSX on 512 byte blocksize filesystems
- Fix rounding error in xfs_free_file_space
- Fix use-after-free with extent free intents
- Add several missing KM_NOFS flags to fix lockdep reports
- Several fixes for CRC related code"

* tag 'for-linus-v3.10-rc3' of git://oss.sgi.com/xfs/xfs:
xfs: remote attribute lookups require the value length
xfs: xfs_attr_shortform_allfit() does not handle attr3 format.
xfs: xfs_da3_node_read_verify() doesn't handle XFS_ATTR3_LEAF_MAGIC
xfs: fix missing KM_NOFS tags to keep lockdep happy
xfs: Don't reference the EFI after it is freed
xfs: fix rounding in xfs_free_file_space
xfs: fix sub-page blocksize data integrity writes

+47 -21
+19
fs/xfs/xfs_aops.c
··· 725 725 (xfs_off_t)(page->index + 1) << PAGE_CACHE_SHIFT, 726 726 i_size_read(inode)); 727 727 728 + /* 729 + * If the current map does not span the entire page we are about to try 730 + * to write, then give up. The only way we can write a page that spans 731 + * multiple mappings in a single writeback iteration is via the 732 + * xfs_vm_writepage() function. Data integrity writeback requires the 733 + * entire page to be written in a single attempt, otherwise the part of 734 + * the page we don't write here doesn't get written as part of the data 735 + * integrity sync. 736 + * 737 + * For normal writeback, we also don't attempt to write partial pages 738 + * here as it simply means that write_cache_pages() will see it under 739 + * writeback and ignore the page until some point in the future, at 740 + * which time this will be the only page in the file that needs 741 + * writeback. Hence for more optimal IO patterns, we should always 742 + * avoid partial page writeback due to multiple mappings on a page here. 743 + */ 744 + if (!xfs_imap_valid(inode, imap, end_offset)) 745 + goto fail_unlock_page; 746 + 728 747 len = 1 << inode->i_blkbits; 729 748 p_offset = min_t(unsigned long, end_offset & (PAGE_CACHE_SIZE - 1), 730 749 PAGE_CACHE_SIZE);
+15 -12
fs/xfs/xfs_attr_leaf.c
··· 931 931 */ 932 932 int 933 933 xfs_attr_shortform_allfit( 934 - struct xfs_buf *bp, 935 - struct xfs_inode *dp) 934 + struct xfs_buf *bp, 935 + struct xfs_inode *dp) 936 936 { 937 - xfs_attr_leafblock_t *leaf; 938 - xfs_attr_leaf_entry_t *entry; 937 + struct xfs_attr_leafblock *leaf; 938 + struct xfs_attr_leaf_entry *entry; 939 939 xfs_attr_leaf_name_local_t *name_loc; 940 - int bytes, i; 940 + struct xfs_attr3_icleaf_hdr leafhdr; 941 + int bytes; 942 + int i; 941 943 942 944 leaf = bp->b_addr; 943 - ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); 945 + xfs_attr3_leaf_hdr_from_disk(&leafhdr, leaf); 946 + entry = xfs_attr3_leaf_entryp(leaf); 944 947 945 - entry = &leaf->entries[0]; 946 948 bytes = sizeof(struct xfs_attr_sf_hdr); 947 - for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { 949 + for (i = 0; i < leafhdr.count; entry++, i++) { 948 950 if (entry->flags & XFS_ATTR_INCOMPLETE) 949 951 continue; /* don't copy partial entries */ 950 952 if (!(entry->flags & XFS_ATTR_LOCAL)) ··· 956 954 return(0); 957 955 if (be16_to_cpu(name_loc->valuelen) >= XFS_ATTR_SF_ENTSIZE_MAX) 958 956 return(0); 959 - bytes += sizeof(struct xfs_attr_sf_entry)-1 957 + bytes += sizeof(struct xfs_attr_sf_entry) - 1 960 958 + name_loc->namelen 961 959 + be16_to_cpu(name_loc->valuelen); 962 960 } 963 961 if ((dp->i_mount->m_flags & XFS_MOUNT_ATTR2) && 964 962 (dp->i_d.di_format != XFS_DINODE_FMT_BTREE) && 965 963 (bytes == sizeof(struct xfs_attr_sf_hdr))) 966 - return(-1); 967 - return(xfs_attr_shortform_bytesfit(dp, bytes)); 964 + return -1; 965 + return xfs_attr_shortform_bytesfit(dp, bytes); 968 966 } 969 967 970 968 /* ··· 2332 2330 if (!xfs_attr_namesp_match(args->flags, entry->flags)) 2333 2331 continue; 2334 2332 args->index = probe; 2333 + args->valuelen = be32_to_cpu(name_rmt->valuelen); 2335 2334 args->rmtblkno = be32_to_cpu(name_rmt->valueblk); 2336 2335 args->rmtblkcnt = XFS_B_TO_FSB(args->dp->i_mount, 2337 - be32_to_cpu(name_rmt->valuelen)); 2336 + args->valuelen); 2338 2337 return XFS_ERROR(EEXIST); 2339 2338 } 2340 2339 }
+1 -1
fs/xfs/xfs_buf.c
··· 1649 1649 { 1650 1650 xfs_buftarg_t *btp; 1651 1651 1652 - btp = kmem_zalloc(sizeof(*btp), KM_SLEEP); 1652 + btp = kmem_zalloc(sizeof(*btp), KM_SLEEP | KM_NOFS); 1653 1653 1654 1654 btp->bt_mount = mp; 1655 1655 btp->bt_dev = bdev->bd_dev;
+5 -2
fs/xfs/xfs_da_btree.c
··· 270 270 break; 271 271 return; 272 272 case XFS_ATTR_LEAF_MAGIC: 273 + case XFS_ATTR3_LEAF_MAGIC: 273 274 bp->b_ops = &xfs_attr3_leaf_buf_ops; 274 275 bp->b_ops->verify_read(bp); 275 276 return; ··· 2465 2464 ASSERT(nirecs >= 1); 2466 2465 2467 2466 if (nirecs > 1) { 2468 - map = kmem_zalloc(nirecs * sizeof(struct xfs_buf_map), KM_SLEEP); 2467 + map = kmem_zalloc(nirecs * sizeof(struct xfs_buf_map), 2468 + KM_SLEEP | KM_NOFS); 2469 2469 if (!map) 2470 2470 return ENOMEM; 2471 2471 *mapp = map; ··· 2522 2520 * Optimize the one-block case. 2523 2521 */ 2524 2522 if (nfsb != 1) 2525 - irecs = kmem_zalloc(sizeof(irec) * nfsb, KM_SLEEP); 2523 + irecs = kmem_zalloc(sizeof(irec) * nfsb, 2524 + KM_SLEEP | KM_NOFS); 2526 2525 2527 2526 nirecs = nfsb; 2528 2527 error = xfs_bmapi_read(dp, (xfs_fileoff_t)bno, nfsb, irecs,
+1 -1
fs/xfs/xfs_dir2_leaf.c
··· 1336 1336 mp->m_sb.sb_blocksize); 1337 1337 map_info = kmem_zalloc(offsetof(struct xfs_dir2_leaf_map_info, map) + 1338 1338 (length * sizeof(struct xfs_bmbt_irec)), 1339 - KM_SLEEP); 1339 + KM_SLEEP | KM_NOFS); 1340 1340 map_info->map_size = length; 1341 1341 1342 1342 /*
+3 -2
fs/xfs/xfs_extfree_item.c
··· 305 305 { 306 306 ASSERT(atomic_read(&efip->efi_next_extent) >= nextents); 307 307 if (atomic_sub_and_test(nextents, &efip->efi_next_extent)) { 308 - __xfs_efi_release(efip); 309 - 310 308 /* recovery needs us to drop the EFI reference, too */ 311 309 if (test_bit(XFS_EFI_RECOVERED, &efip->efi_flags)) 312 310 __xfs_efi_release(efip); 311 + 312 + __xfs_efi_release(efip); 313 + /* efip may now have been freed, do not reference it again. */ 313 314 } 314 315 } 315 316
+1 -1
fs/xfs/xfs_log_cil.c
··· 139 139 140 140 new_lv = kmem_zalloc(sizeof(*new_lv) + 141 141 niovecs * sizeof(struct xfs_log_iovec), 142 - KM_SLEEP); 142 + KM_SLEEP|KM_NOFS); 143 143 144 144 /* The allocated iovec region lies beyond the log vector. */ 145 145 new_lv->lv_iovecp = (struct xfs_log_iovec *)&new_lv[1];
+2 -2
fs/xfs/xfs_vnodeops.c
··· 1453 1453 xfs_mount_t *mp; 1454 1454 int nimap; 1455 1455 uint resblks; 1456 - uint rounding; 1456 + xfs_off_t rounding; 1457 1457 int rt; 1458 1458 xfs_fileoff_t startoffset_fsb; 1459 1459 xfs_trans_t *tp; ··· 1482 1482 inode_dio_wait(VFS_I(ip)); 1483 1483 } 1484 1484 1485 - rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); 1485 + rounding = max_t(xfs_off_t, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); 1486 1486 ioffset = offset & ~(rounding - 1); 1487 1487 error = -filemap_write_and_wait_range(VFS_I(ip)->i_mapping, 1488 1488 ioffset, -1);