From c7f277c934f0b5e02099daeb7263a7f821171b3b Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 18 May 2006 15:49:52 +0000 Subject: [PATCH] Fix some leaked references on buffers in dabufs in phase6. Merge of master-melb:xfs-cmds:25964a by kenmcd. --- repair/phase6.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/repair/phase6.c b/repair/phase6.c index 5134282d3..5297c8081 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -1900,10 +1900,13 @@ longform_dir2_entry_check_data( addr, dep->name[0] == '/'); /* * skip bogus entries (leading '/'). they'll be deleted - * later + * later. must still log it, else we leak references to + * buffers. */ if (dep->name[0] == '/') { nbad++; + if (!no_modify) + libxfs_dir2_data_log_entry(tp, bp, dep); continue; } junkit = 0; @@ -2070,6 +2073,8 @@ _("entry \"%s\" in dir inode %llu inconsistent with .. value (%llu) in ino %llu, libxfs_dir2_data_freescan(mp, d, &needlog, NULL); if (needlog) libxfs_dir2_data_log_header(tp, bp); + else if (!isblock && !nbad) + libxfs_da_brelse(tp, bp); libxfs_bmap_finish(&tp, &flist, firstblock, &committed); libxfs_trans_commit(tp, 0, 0); freetab->ents[db].v = INT_GET(d->hdr.bestfree[0].length, ARCH_CONVERT); @@ -2347,6 +2352,8 @@ longform_dir2_rebuild_setup( if (needscan) libxfs_dir2_data_freescan(mp, data, &needlog, NULL); libxfs_da_log_buf(tp, dbp, 0, mp->m_dirblksize - 1); + } else if (dbp) { + libxfs_da_brelse(tp, dbp); } /* allocate blocks for btree */ -- 2.47.2