From 4491caa3975807766c6e084aa4580b3cfd8b5582 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Mon, 24 Aug 2015 11:52:45 +1000 Subject: [PATCH] xfs_repair: call IRELE(ip) after libxfs_trans_iget calls Commit 260c85e libxfs: dont free xfs_inode until complete changed the alloc/free convention a bit: Originally, the xfs_inode are released upon the first call to xfs_trans_cancel, xfs_trans_commit, or inode_item_done. This patch does the following: 1) Removes the iput from the transaction completion and requires that the xfs_inode allocators call IRELE() when they are done with the pointer. But that change missed several callers in xfs_repair phase6; fix that up. Addresses-Coverity-Id: 1315100 Addresses-Coverity-Id: 1315101 Signed-off-by: Eric Sandeen Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- repair/phase6.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/repair/phase6.c b/repair/phase6.c index 9cfedbfbc..04638c203 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -585,6 +585,7 @@ mk_rbmino(xfs_mount_t *mp) error); } libxfs_trans_commit(tp); + IRELE(ip); } static int @@ -654,6 +655,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime bitmap inode % } libxfs_trans_commit(tp); + IRELE(ip); return(0); } @@ -714,6 +716,7 @@ fill_rsumino(xfs_mount_t *mp) do_warn( _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inode %" PRIu64 "\n"), bno, map.br_startblock, mp->m_sb.sb_rsumino); + IRELE(ip); return(1); } @@ -726,6 +729,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inode } libxfs_trans_commit(tp); + IRELE(ip); return(0); } @@ -846,6 +850,7 @@ mk_rsumino(xfs_mount_t *mp) error); } libxfs_trans_commit(tp); + IRELE(ip); } /* @@ -920,6 +925,7 @@ mk_root_dir(xfs_mount_t *mp) libxfs_dir_init(tp, ip, ip); libxfs_trans_commit(tp); + IRELE(ip); irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino), XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rootino)); -- 2.47.2