aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_inode_fork.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 21:05:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 21:05:23 -0500
commita27fcb0cd1bcc812017192bdde41cc456dcd6afe (patch)
tree95f3ac980e2a50d9132074fd07c0cd684bbbf124 /fs/xfs/libxfs/xfs_inode_fork.c
parent7d91de74436a69c2b78a7a72f1e7f97f8b4396fa (diff)
parent8d242e932fb7660c24b3a534197e69c241067e0d (diff)
Merge tag 'xfs-4.11-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs updates from Darrick Wong: "Here are the XFS changes for 4.11. We aren't introducing any major features in this release cycle except for this being the first merge window I've managed on my own. :) Changes since last update: - Various cleanups - Livelock fixes for eofblocks scanning - Improved input verification for on-disk metadata - Fix races in the copy on write remap mechanism - Fix buffer io error timeout controls - Streamlining of directio copy on write - Asynchronous discard support - Fix asserts when splitting delalloc reservations - Don't bloat bmbt when right shifting extents - Inode alignment fixes for 32k block sizes" * tag 'xfs-4.11-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (39 commits) xfs: remove XFS_ALLOCTYPE_ANY_AG and XFS_ALLOCTYPE_START_AG xfs: simplify xfs_rtallocate_extent xfs: tune down agno asserts in the bmap code xfs: Use xfs_icluster_size_fsb() to calculate inode chunk alignment xfs: don't reserve blocks for right shift transactions xfs: fix len comparison in xfs_extent_busy_trim xfs: fix uninitialized variable in _reflink_convert_cow xfs: split indlen reservations fairly when under reserved xfs: handle indlen shortage on delalloc extent merge xfs: resurrect debug mode drop buffered writes mechanism xfs: clear delalloc and cache on buffered write failure xfs: don't block the log commit handler for discards xfs: improve busy extent sorting xfs: improve handling of busy extents in the low-level allocator xfs: don't fail xfs_extent_busy allocation xfs: correct null checks and error processing in xfs_initialize_perag xfs: update ctime and mtime on clone destinatation inodes xfs: allocate direct I/O COW blocks in iomap_begin xfs: go straight to real allocations for direct I/O COW writes xfs: return the converted extent in __xfs_reflink_convert_cow ...
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_fork.c')
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
index 222e103356c6..25c1e078aef6 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.c
+++ b/fs/xfs/libxfs/xfs_inode_fork.c
@@ -26,6 +26,7 @@
26#include "xfs_inode.h" 26#include "xfs_inode.h"
27#include "xfs_trans.h" 27#include "xfs_trans.h"
28#include "xfs_inode_item.h" 28#include "xfs_inode_item.h"
29#include "xfs_btree.h"
29#include "xfs_bmap_btree.h" 30#include "xfs_bmap_btree.h"
30#include "xfs_bmap.h" 31#include "xfs_bmap.h"
31#include "xfs_error.h" 32#include "xfs_error.h"
@@ -429,11 +430,13 @@ xfs_iformat_btree(
429 /* REFERENCED */ 430 /* REFERENCED */
430 int nrecs; 431 int nrecs;
431 int size; 432 int size;
433 int level;
432 434
433 ifp = XFS_IFORK_PTR(ip, whichfork); 435 ifp = XFS_IFORK_PTR(ip, whichfork);
434 dfp = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork); 436 dfp = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
435 size = XFS_BMAP_BROOT_SPACE(mp, dfp); 437 size = XFS_BMAP_BROOT_SPACE(mp, dfp);
436 nrecs = be16_to_cpu(dfp->bb_numrecs); 438 nrecs = be16_to_cpu(dfp->bb_numrecs);
439 level = be16_to_cpu(dfp->bb_level);
437 440
438 /* 441 /*
439 * blow out if -- fork has less extents than can fit in 442 * blow out if -- fork has less extents than can fit in
@@ -446,7 +449,8 @@ xfs_iformat_btree(
446 XFS_IFORK_MAXEXT(ip, whichfork) || 449 XFS_IFORK_MAXEXT(ip, whichfork) ||
447 XFS_BMDR_SPACE_CALC(nrecs) > 450 XFS_BMDR_SPACE_CALC(nrecs) >
448 XFS_DFORK_SIZE(dip, mp, whichfork) || 451 XFS_DFORK_SIZE(dip, mp, whichfork) ||
449 XFS_IFORK_NEXTENTS(ip, whichfork) > ip->i_d.di_nblocks)) { 452 XFS_IFORK_NEXTENTS(ip, whichfork) > ip->i_d.di_nblocks) ||
453 level == 0 || level > XFS_BTREE_MAXLEVELS) {
450 xfs_warn(mp, "corrupt inode %Lu (btree).", 454 xfs_warn(mp, "corrupt inode %Lu (btree).",
451 (unsigned long long) ip->i_ino); 455 (unsigned long long) ip->i_ino);
452 XFS_CORRUPTION_ERROR("xfs_iformat_btree", XFS_ERRLEVEL_LOW, 456 XFS_CORRUPTION_ERROR("xfs_iformat_btree", XFS_ERRLEVEL_LOW,
@@ -497,15 +501,14 @@ xfs_iread_extents(
497 * We know that the size is valid (it's checked in iformat_btree) 501 * We know that the size is valid (it's checked in iformat_btree)
498 */ 502 */
499 ifp->if_bytes = ifp->if_real_bytes = 0; 503 ifp->if_bytes = ifp->if_real_bytes = 0;
500 ifp->if_flags |= XFS_IFEXTENTS;
501 xfs_iext_add(ifp, 0, nextents); 504 xfs_iext_add(ifp, 0, nextents);
502 error = xfs_bmap_read_extents(tp, ip, whichfork); 505 error = xfs_bmap_read_extents(tp, ip, whichfork);
503 if (error) { 506 if (error) {
504 xfs_iext_destroy(ifp); 507 xfs_iext_destroy(ifp);
505 ifp->if_flags &= ~XFS_IFEXTENTS;
506 return error; 508 return error;
507 } 509 }
508 xfs_validate_extents(ifp, nextents, XFS_EXTFMT_INODE(ip)); 510 xfs_validate_extents(ifp, nextents, XFS_EXTFMT_INODE(ip));
511 ifp->if_flags |= XFS_IFEXTENTS;
509 return 0; 512 return 0;
510} 513}
511/* 514/*