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

Pull xfs fixes from Dave Chinner:
"The main fix is adding support for default ACLs on O_TMPFILE opened
inodes to bring XFS into line with other filesystems. Metadata CRCs
are now also considered well enough tested to be fully supported, so
we're removing the shouty warnings issued at mount time for
filesystems with that format. And there's transaction block
reservation overrun fix.

Summary:
- fix a remote attribute size calculation bug that leads to a
transaction overrun
- add default ACLs to O_TMPFILE files
- Remove the EXPERIMENTAL tag from filesystems with metadata CRC
support"

* tag 'xfs-for-linus-3.15-rc5' of git://oss.sgi.com/xfs/xfs:
xfs: remote attribute overwrite causes transaction overrun
xfs: initialize default acls for ->tmpfile()
xfs: fully support v5 format filesystems

+77 -50
+23 -1
fs/xfs/xfs_attr.c
··· 213 213 * Out of line attribute, cannot double split, but 214 214 * make room for the attribute value itself. 215 215 */ 216 - uint dblocks = XFS_B_TO_FSB(mp, valuelen); 216 + uint dblocks = xfs_attr3_rmt_blocks(mp, valuelen); 217 217 nblks += dblocks; 218 218 nblks += XFS_NEXTENTADD_SPACE_RES(mp, dblocks, XFS_ATTR_FORK); 219 219 } ··· 698 698 699 699 trace_xfs_attr_leaf_replace(args); 700 700 701 + /* save the attribute state for later removal*/ 701 702 args->op_flags |= XFS_DA_OP_RENAME; /* an atomic rename */ 702 703 args->blkno2 = args->blkno; /* set 2nd entry info*/ 703 704 args->index2 = args->index; 704 705 args->rmtblkno2 = args->rmtblkno; 705 706 args->rmtblkcnt2 = args->rmtblkcnt; 707 + args->rmtvaluelen2 = args->rmtvaluelen; 708 + 709 + /* 710 + * clear the remote attr state now that it is saved so that the 711 + * values reflect the state of the attribute we are about to 712 + * add, not the attribute we just found and will remove later. 713 + */ 714 + args->rmtblkno = 0; 715 + args->rmtblkcnt = 0; 716 + args->rmtvaluelen = 0; 706 717 } 707 718 708 719 /* ··· 805 794 args->blkno = args->blkno2; 806 795 args->rmtblkno = args->rmtblkno2; 807 796 args->rmtblkcnt = args->rmtblkcnt2; 797 + args->rmtvaluelen = args->rmtvaluelen2; 808 798 if (args->rmtblkno) { 809 799 error = xfs_attr_rmtval_remove(args); 810 800 if (error) ··· 1011 999 1012 1000 trace_xfs_attr_node_replace(args); 1013 1001 1002 + /* save the attribute state for later removal*/ 1014 1003 args->op_flags |= XFS_DA_OP_RENAME; /* atomic rename op */ 1015 1004 args->blkno2 = args->blkno; /* set 2nd entry info*/ 1016 1005 args->index2 = args->index; 1017 1006 args->rmtblkno2 = args->rmtblkno; 1018 1007 args->rmtblkcnt2 = args->rmtblkcnt; 1008 + args->rmtvaluelen2 = args->rmtvaluelen; 1009 + 1010 + /* 1011 + * clear the remote attr state now that it is saved so that the 1012 + * values reflect the state of the attribute we are about to 1013 + * add, not the attribute we just found and will remove later. 1014 + */ 1019 1015 args->rmtblkno = 0; 1020 1016 args->rmtblkcnt = 0; 1017 + args->rmtvaluelen = 0; 1021 1018 } 1022 1019 1023 1020 retval = xfs_attr3_leaf_add(blk->bp, state->args); ··· 1154 1133 args->blkno = args->blkno2; 1155 1134 args->rmtblkno = args->rmtblkno2; 1156 1135 args->rmtblkcnt = args->rmtblkcnt2; 1136 + args->rmtvaluelen = args->rmtvaluelen2; 1157 1137 if (args->rmtblkno) { 1158 1138 error = xfs_attr_rmtval_remove(args); 1159 1139 if (error)
+11 -10
fs/xfs/xfs_attr_leaf.c
··· 1229 1229 name_rmt->valueblk = 0; 1230 1230 args->rmtblkno = 1; 1231 1231 args->rmtblkcnt = xfs_attr3_rmt_blocks(mp, args->valuelen); 1232 + args->rmtvaluelen = args->valuelen; 1232 1233 } 1233 1234 xfs_trans_log_buf(args->trans, bp, 1234 1235 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index), ··· 2168 2167 if (!xfs_attr_namesp_match(args->flags, entry->flags)) 2169 2168 continue; 2170 2169 args->index = probe; 2171 - args->valuelen = be32_to_cpu(name_rmt->valuelen); 2170 + args->rmtvaluelen = be32_to_cpu(name_rmt->valuelen); 2172 2171 args->rmtblkno = be32_to_cpu(name_rmt->valueblk); 2173 2172 args->rmtblkcnt = xfs_attr3_rmt_blocks( 2174 2173 args->dp->i_mount, 2175 - args->valuelen); 2174 + args->rmtvaluelen); 2176 2175 return XFS_ERROR(EEXIST); 2177 2176 } 2178 2177 } ··· 2221 2220 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); 2222 2221 ASSERT(name_rmt->namelen == args->namelen); 2223 2222 ASSERT(memcmp(args->name, name_rmt->name, args->namelen) == 0); 2224 - valuelen = be32_to_cpu(name_rmt->valuelen); 2223 + args->rmtvaluelen = be32_to_cpu(name_rmt->valuelen); 2225 2224 args->rmtblkno = be32_to_cpu(name_rmt->valueblk); 2226 2225 args->rmtblkcnt = xfs_attr3_rmt_blocks(args->dp->i_mount, 2227 - valuelen); 2226 + args->rmtvaluelen); 2228 2227 if (args->flags & ATTR_KERNOVAL) { 2229 - args->valuelen = valuelen; 2228 + args->valuelen = args->rmtvaluelen; 2230 2229 return 0; 2231 2230 } 2232 - if (args->valuelen < valuelen) { 2233 - args->valuelen = valuelen; 2231 + if (args->valuelen < args->rmtvaluelen) { 2232 + args->valuelen = args->rmtvaluelen; 2234 2233 return XFS_ERROR(ERANGE); 2235 2234 } 2236 - args->valuelen = valuelen; 2235 + args->valuelen = args->rmtvaluelen; 2237 2236 } 2238 2237 return 0; 2239 2238 } ··· 2520 2519 ASSERT((entry->flags & XFS_ATTR_LOCAL) == 0); 2521 2520 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); 2522 2521 name_rmt->valueblk = cpu_to_be32(args->rmtblkno); 2523 - name_rmt->valuelen = cpu_to_be32(args->valuelen); 2522 + name_rmt->valuelen = cpu_to_be32(args->rmtvaluelen); 2524 2523 xfs_trans_log_buf(args->trans, bp, 2525 2524 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); 2526 2525 } ··· 2678 2677 ASSERT((entry1->flags & XFS_ATTR_LOCAL) == 0); 2679 2678 name_rmt = xfs_attr3_leaf_name_remote(leaf1, args->index); 2680 2679 name_rmt->valueblk = cpu_to_be32(args->rmtblkno); 2681 - name_rmt->valuelen = cpu_to_be32(args->valuelen); 2680 + name_rmt->valuelen = cpu_to_be32(args->rmtvaluelen); 2682 2681 xfs_trans_log_buf(args->trans, bp1, 2683 2682 XFS_DA_LOGRANGE(leaf1, name_rmt, sizeof(*name_rmt))); 2684 2683 }
+1
fs/xfs/xfs_attr_list.c
··· 447 447 args.dp = context->dp; 448 448 args.whichfork = XFS_ATTR_FORK; 449 449 args.valuelen = valuelen; 450 + args.rmtvaluelen = valuelen; 450 451 args.value = kmem_alloc(valuelen, KM_SLEEP | KM_NOFS); 451 452 args.rmtblkno = be32_to_cpu(name_rmt->valueblk); 452 453 args.rmtblkcnt = xfs_attr3_rmt_blocks(
+5 -3
fs/xfs/xfs_attr_remote.c
··· 337 337 struct xfs_buf *bp; 338 338 xfs_dablk_t lblkno = args->rmtblkno; 339 339 __uint8_t *dst = args->value; 340 - int valuelen = args->valuelen; 340 + int valuelen; 341 341 int nmap; 342 342 int error; 343 343 int blkcnt = args->rmtblkcnt; ··· 347 347 trace_xfs_attr_rmtval_get(args); 348 348 349 349 ASSERT(!(args->flags & ATTR_KERNOVAL)); 350 + ASSERT(args->rmtvaluelen == args->valuelen); 350 351 352 + valuelen = args->rmtvaluelen; 351 353 while (valuelen > 0) { 352 354 nmap = ATTR_RMTVALUE_MAPSIZE; 353 355 error = xfs_bmapi_read(args->dp, (xfs_fileoff_t)lblkno, ··· 417 415 * attributes have headers, we can't just do a straight byte to FSB 418 416 * conversion and have to take the header space into account. 419 417 */ 420 - blkcnt = xfs_attr3_rmt_blocks(mp, args->valuelen); 418 + blkcnt = xfs_attr3_rmt_blocks(mp, args->rmtvaluelen); 421 419 error = xfs_bmap_first_unused(args->trans, args->dp, blkcnt, &lfileoff, 422 420 XFS_ATTR_FORK); 423 421 if (error) ··· 482 480 */ 483 481 lblkno = args->rmtblkno; 484 482 blkcnt = args->rmtblkcnt; 485 - valuelen = args->valuelen; 483 + valuelen = args->rmtvaluelen; 486 484 while (valuelen > 0) { 487 485 struct xfs_buf *bp; 488 486 xfs_daddr_t dblkno;
+2
fs/xfs/xfs_da_btree.h
··· 60 60 int index; /* index of attr of interest in blk */ 61 61 xfs_dablk_t rmtblkno; /* remote attr value starting blkno */ 62 62 int rmtblkcnt; /* remote attr value block count */ 63 + int rmtvaluelen; /* remote attr value length in bytes */ 63 64 xfs_dablk_t blkno2; /* blkno of 2nd attr leaf of interest */ 64 65 int index2; /* index of 2nd attr in blk */ 65 66 xfs_dablk_t rmtblkno2; /* remote attr value starting blkno */ 66 67 int rmtblkcnt2; /* remote attr value block count */ 68 + int rmtvaluelen2; /* remote attr value length in bytes */ 67 69 int op_flags; /* operation flags */ 68 70 enum xfs_dacmp cmpresult; /* name compare result for lookups */ 69 71 } xfs_da_args_t;
+29 -26
fs/xfs/xfs_iops.c
··· 124 124 xfs_dentry_to_name(&teardown, dentry, 0); 125 125 126 126 xfs_remove(XFS_I(dir), &teardown, XFS_I(inode)); 127 - iput(inode); 128 127 } 129 128 130 129 STATIC int 131 - xfs_vn_mknod( 130 + xfs_generic_create( 132 131 struct inode *dir, 133 132 struct dentry *dentry, 134 133 umode_t mode, 135 - dev_t rdev) 134 + dev_t rdev, 135 + bool tmpfile) /* unnamed file */ 136 136 { 137 137 struct inode *inode; 138 138 struct xfs_inode *ip = NULL; ··· 156 156 if (error) 157 157 return error; 158 158 159 - xfs_dentry_to_name(&name, dentry, mode); 160 - error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip); 159 + if (!tmpfile) { 160 + xfs_dentry_to_name(&name, dentry, mode); 161 + error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip); 162 + } else { 163 + error = xfs_create_tmpfile(XFS_I(dir), dentry, mode, &ip); 164 + } 161 165 if (unlikely(error)) 162 166 goto out_free_acl; 163 167 ··· 184 180 } 185 181 #endif 186 182 187 - d_instantiate(dentry, inode); 183 + if (tmpfile) 184 + d_tmpfile(dentry, inode); 185 + else 186 + d_instantiate(dentry, inode); 187 + 188 188 out_free_acl: 189 189 if (default_acl) 190 190 posix_acl_release(default_acl); ··· 197 189 return -error; 198 190 199 191 out_cleanup_inode: 200 - xfs_cleanup_inode(dir, inode, dentry); 192 + if (!tmpfile) 193 + xfs_cleanup_inode(dir, inode, dentry); 194 + iput(inode); 201 195 goto out_free_acl; 196 + } 197 + 198 + STATIC int 199 + xfs_vn_mknod( 200 + struct inode *dir, 201 + struct dentry *dentry, 202 + umode_t mode, 203 + dev_t rdev) 204 + { 205 + return xfs_generic_create(dir, dentry, mode, rdev, false); 202 206 } 203 207 204 208 STATIC int ··· 373 353 374 354 out_cleanup_inode: 375 355 xfs_cleanup_inode(dir, inode, dentry); 356 + iput(inode); 376 357 out: 377 358 return -error; 378 359 } ··· 1074 1053 struct dentry *dentry, 1075 1054 umode_t mode) 1076 1055 { 1077 - int error; 1078 - struct xfs_inode *ip; 1079 - struct inode *inode; 1080 - 1081 - error = xfs_create_tmpfile(XFS_I(dir), dentry, mode, &ip); 1082 - if (unlikely(error)) 1083 - return -error; 1084 - 1085 - inode = VFS_I(ip); 1086 - 1087 - error = xfs_init_security(inode, dir, &dentry->d_name); 1088 - if (unlikely(error)) { 1089 - iput(inode); 1090 - return -error; 1091 - } 1092 - 1093 - d_tmpfile(dentry, inode); 1094 - 1095 - return 0; 1056 + return xfs_generic_create(dir, dentry, mode, 0, true); 1096 1057 } 1097 1058 1098 1059 static const struct inode_operations xfs_inode_operations = {
+6 -4
fs/xfs/xfs_log.c
··· 616 616 int error = 0; 617 617 int min_logfsbs; 618 618 619 - if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) 620 - xfs_notice(mp, "Mounting Filesystem"); 621 - else { 619 + if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) { 620 + xfs_notice(mp, "Mounting V%d Filesystem", 621 + XFS_SB_VERSION_NUM(&mp->m_sb)); 622 + } else { 622 623 xfs_notice(mp, 623 - "Mounting filesystem in no-recovery mode. Filesystem will be inconsistent."); 624 + "Mounting V%d filesystem in no-recovery mode. Filesystem will be inconsistent.", 625 + XFS_SB_VERSION_NUM(&mp->m_sb)); 624 626 ASSERT(mp->m_flags & XFS_MOUNT_RDONLY); 625 627 } 626 628
-2
fs/xfs/xfs_mount.c
··· 743 743 new_size *= mp->m_sb.sb_inodesize / XFS_DINODE_MIN_SIZE; 744 744 if (mp->m_sb.sb_inoalignmt >= XFS_B_TO_FSBT(mp, new_size)) 745 745 mp->m_inode_cluster_size = new_size; 746 - xfs_info(mp, "Using inode cluster size of %d bytes", 747 - mp->m_inode_cluster_size); 748 746 } 749 747 750 748 /*
-4
fs/xfs/xfs_sb.c
··· 201 201 * write validation, we don't need to check feature masks. 202 202 */ 203 203 if (check_version && XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) { 204 - xfs_alert(mp, 205 - "Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!\n" 206 - "Use of these features in this kernel is at your own risk!"); 207 - 208 204 if (xfs_sb_has_compat_feature(sbp, 209 205 XFS_SB_FEAT_COMPAT_UNKNOWN)) { 210 206 xfs_warn(mp,