diff options
Diffstat (limited to 'fs/xfs/xfs_inode_item.c')
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 565d470a6b4a..034ca7202295 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -274,6 +274,11 @@ xfs_inode_item_format( | |||
274 | */ | 274 | */ |
275 | xfs_synchronize_atime(ip); | 275 | xfs_synchronize_atime(ip); |
276 | 276 | ||
277 | /* | ||
278 | * make sure the linux inode is dirty | ||
279 | */ | ||
280 | xfs_mark_inode_dirty_sync(ip); | ||
281 | |||
277 | vecp->i_addr = (xfs_caddr_t)&ip->i_d; | 282 | vecp->i_addr = (xfs_caddr_t)&ip->i_d; |
278 | vecp->i_len = sizeof(xfs_dinode_core_t); | 283 | vecp->i_len = sizeof(xfs_dinode_core_t); |
279 | XLOG_VEC_SET_TYPE(vecp, XLOG_REG_TYPE_ICORE); | 284 | XLOG_VEC_SET_TYPE(vecp, XLOG_REG_TYPE_ICORE); |
@@ -615,7 +620,7 @@ xfs_inode_item_trylock( | |||
615 | return XFS_ITEM_PUSHBUF; | 620 | return XFS_ITEM_PUSHBUF; |
616 | } else { | 621 | } else { |
617 | /* | 622 | /* |
618 | * We hold the AIL_LOCK, so we must specify the | 623 | * We hold the AIL lock, so we must specify the |
619 | * NONOTIFY flag so that we won't double trip. | 624 | * NONOTIFY flag so that we won't double trip. |
620 | */ | 625 | */ |
621 | xfs_iunlock(ip, XFS_ILOCK_SHARED|XFS_IUNLOCK_NONOTIFY); | 626 | xfs_iunlock(ip, XFS_ILOCK_SHARED|XFS_IUNLOCK_NONOTIFY); |
@@ -749,7 +754,7 @@ xfs_inode_item_committed( | |||
749 | * marked delayed write. If that's the case, we'll initiate a bawrite on that | 754 | * marked delayed write. If that's the case, we'll initiate a bawrite on that |
750 | * buffer to expedite the process. | 755 | * buffer to expedite the process. |
751 | * | 756 | * |
752 | * We aren't holding the AIL_LOCK (or the flush lock) when this gets called, | 757 | * We aren't holding the AIL lock (or the flush lock) when this gets called, |
753 | * so it is inherently race-y. | 758 | * so it is inherently race-y. |
754 | */ | 759 | */ |
755 | STATIC void | 760 | STATIC void |
@@ -792,7 +797,7 @@ xfs_inode_item_pushbuf( | |||
792 | if (XFS_BUF_ISDELAYWRITE(bp)) { | 797 | if (XFS_BUF_ISDELAYWRITE(bp)) { |
793 | /* | 798 | /* |
794 | * We were racing with iflush because we don't hold | 799 | * We were racing with iflush because we don't hold |
795 | * the AIL_LOCK or the flush lock. However, at this point, | 800 | * the AIL lock or the flush lock. However, at this point, |
796 | * we have the buffer, and we know that it's dirty. | 801 | * we have the buffer, and we know that it's dirty. |
797 | * So, it's possible that iflush raced with us, and | 802 | * So, it's possible that iflush raced with us, and |
798 | * this item is already taken off the AIL. | 803 | * this item is already taken off the AIL. |
@@ -968,7 +973,6 @@ xfs_iflush_done( | |||
968 | xfs_inode_log_item_t *iip) | 973 | xfs_inode_log_item_t *iip) |
969 | { | 974 | { |
970 | xfs_inode_t *ip; | 975 | xfs_inode_t *ip; |
971 | SPLDECL(s); | ||
972 | 976 | ||
973 | ip = iip->ili_inode; | 977 | ip = iip->ili_inode; |
974 | 978 | ||
@@ -983,15 +987,15 @@ xfs_iflush_done( | |||
983 | */ | 987 | */ |
984 | if (iip->ili_logged && | 988 | if (iip->ili_logged && |
985 | (iip->ili_item.li_lsn == iip->ili_flush_lsn)) { | 989 | (iip->ili_item.li_lsn == iip->ili_flush_lsn)) { |
986 | AIL_LOCK(ip->i_mount, s); | 990 | spin_lock(&ip->i_mount->m_ail_lock); |
987 | if (iip->ili_item.li_lsn == iip->ili_flush_lsn) { | 991 | if (iip->ili_item.li_lsn == iip->ili_flush_lsn) { |
988 | /* | 992 | /* |
989 | * xfs_trans_delete_ail() drops the AIL lock. | 993 | * xfs_trans_delete_ail() drops the AIL lock. |
990 | */ | 994 | */ |
991 | xfs_trans_delete_ail(ip->i_mount, | 995 | xfs_trans_delete_ail(ip->i_mount, |
992 | (xfs_log_item_t*)iip, s); | 996 | (xfs_log_item_t*)iip); |
993 | } else { | 997 | } else { |
994 | AIL_UNLOCK(ip->i_mount, s); | 998 | spin_unlock(&ip->i_mount->m_ail_lock); |
995 | } | 999 | } |
996 | } | 1000 | } |
997 | 1001 | ||
@@ -1025,21 +1029,19 @@ xfs_iflush_abort( | |||
1025 | { | 1029 | { |
1026 | xfs_inode_log_item_t *iip; | 1030 | xfs_inode_log_item_t *iip; |
1027 | xfs_mount_t *mp; | 1031 | xfs_mount_t *mp; |
1028 | SPLDECL(s); | ||
1029 | 1032 | ||
1030 | iip = ip->i_itemp; | 1033 | iip = ip->i_itemp; |
1031 | mp = ip->i_mount; | 1034 | mp = ip->i_mount; |
1032 | if (iip) { | 1035 | if (iip) { |
1033 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { | 1036 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { |
1034 | AIL_LOCK(mp, s); | 1037 | spin_lock(&mp->m_ail_lock); |
1035 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { | 1038 | if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { |
1036 | /* | 1039 | /* |
1037 | * xfs_trans_delete_ail() drops the AIL lock. | 1040 | * xfs_trans_delete_ail() drops the AIL lock. |
1038 | */ | 1041 | */ |
1039 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)iip, | 1042 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)iip); |
1040 | s); | ||
1041 | } else | 1043 | } else |
1042 | AIL_UNLOCK(mp, s); | 1044 | spin_unlock(&mp->m_ail_lock); |
1043 | } | 1045 | } |
1044 | iip->ili_logged = 0; | 1046 | iip->ili_logged = 0; |
1045 | /* | 1047 | /* |