diff options
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index c4eca5ed5dab..a434f287962d 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -538,7 +538,9 @@ xfs_readlink_bmap( | |||
538 | d = XFS_FSB_TO_DADDR(mp, mval[n].br_startblock); | 538 | d = XFS_FSB_TO_DADDR(mp, mval[n].br_startblock); |
539 | byte_cnt = XFS_FSB_TO_B(mp, mval[n].br_blockcount); | 539 | byte_cnt = XFS_FSB_TO_B(mp, mval[n].br_blockcount); |
540 | 540 | ||
541 | bp = xfs_buf_read(mp->m_ddev_targp, d, BTOBB(byte_cnt), 0); | 541 | bp = xfs_buf_read_flags(mp->m_ddev_targp, d, BTOBB(byte_cnt), |
542 | XBF_LOCK | XBF_MAPPED | | ||
543 | XBF_DONT_BLOCK); | ||
542 | error = XFS_BUF_GETERROR(bp); | 544 | error = XFS_BUF_GETERROR(bp); |
543 | if (error) { | 545 | if (error) { |
544 | xfs_ioerror_alert("xfs_readlink", | 546 | xfs_ioerror_alert("xfs_readlink", |
@@ -609,7 +611,7 @@ xfs_fsync( | |||
609 | xfs_inode_t *ip) | 611 | xfs_inode_t *ip) |
610 | { | 612 | { |
611 | xfs_trans_t *tp; | 613 | xfs_trans_t *tp; |
612 | int error; | 614 | int error = 0; |
613 | int log_flushed = 0, changed = 1; | 615 | int log_flushed = 0, changed = 1; |
614 | 616 | ||
615 | xfs_itrace_entry(ip); | 617 | xfs_itrace_entry(ip); |
@@ -617,14 +619,9 @@ xfs_fsync( | |||
617 | if (XFS_FORCED_SHUTDOWN(ip->i_mount)) | 619 | if (XFS_FORCED_SHUTDOWN(ip->i_mount)) |
618 | return XFS_ERROR(EIO); | 620 | return XFS_ERROR(EIO); |
619 | 621 | ||
620 | /* capture size updates in I/O completion before writing the inode. */ | ||
621 | error = xfs_wait_on_pages(ip, 0, -1); | ||
622 | if (error) | ||
623 | return XFS_ERROR(error); | ||
624 | |||
625 | /* | 622 | /* |
626 | * We always need to make sure that the required inode state is safe on | 623 | * We always need to make sure that the required inode state is safe on |
627 | * disk. The vnode might be clean but we still might need to force the | 624 | * disk. The inode might be clean but we still might need to force the |
628 | * log because of committed transactions that haven't hit the disk yet. | 625 | * log because of committed transactions that haven't hit the disk yet. |
629 | * Likewise, there could be unflushed non-transactional changes to the | 626 | * Likewise, there could be unflushed non-transactional changes to the |
630 | * inode core that have to go to disk and this requires us to issue | 627 | * inode core that have to go to disk and this requires us to issue |
@@ -636,7 +633,7 @@ xfs_fsync( | |||
636 | */ | 633 | */ |
637 | xfs_ilock(ip, XFS_ILOCK_SHARED); | 634 | xfs_ilock(ip, XFS_ILOCK_SHARED); |
638 | 635 | ||
639 | if (!(ip->i_update_size || ip->i_update_core)) { | 636 | if (!ip->i_update_core) { |
640 | /* | 637 | /* |
641 | * Timestamps/size haven't changed since last inode flush or | 638 | * Timestamps/size haven't changed since last inode flush or |
642 | * inode transaction commit. That means either nothing got | 639 | * inode transaction commit. That means either nothing got |
@@ -716,7 +713,7 @@ xfs_fsync( | |||
716 | * when the link count isn't zero and by xfs_dm_punch_hole() when | 713 | * when the link count isn't zero and by xfs_dm_punch_hole() when |
717 | * punching a hole to EOF. | 714 | * punching a hole to EOF. |
718 | */ | 715 | */ |
719 | int | 716 | STATIC int |
720 | xfs_free_eofblocks( | 717 | xfs_free_eofblocks( |
721 | xfs_mount_t *mp, | 718 | xfs_mount_t *mp, |
722 | xfs_inode_t *ip, | 719 | xfs_inode_t *ip, |
@@ -1474,8 +1471,8 @@ xfs_create( | |||
1474 | if (error == ENOSPC) { | 1471 | if (error == ENOSPC) { |
1475 | /* flush outstanding delalloc blocks and retry */ | 1472 | /* flush outstanding delalloc blocks and retry */ |
1476 | xfs_flush_inodes(dp); | 1473 | xfs_flush_inodes(dp); |
1477 | error = xfs_trans_reserve(tp, resblks, XFS_CREATE_LOG_RES(mp), 0, | 1474 | error = xfs_trans_reserve(tp, resblks, log_res, 0, |
1478 | XFS_TRANS_PERM_LOG_RES, XFS_CREATE_LOG_COUNT); | 1475 | XFS_TRANS_PERM_LOG_RES, log_count); |
1479 | } | 1476 | } |
1480 | if (error == ENOSPC) { | 1477 | if (error == ENOSPC) { |
1481 | /* No space at all so try a "no-allocation" reservation */ | 1478 | /* No space at all so try a "no-allocation" reservation */ |