]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Fix some leaked references on buffers in dabufs in phase6.
authorNathan Scott <nathans@sgi.com>
Thu, 18 May 2006 15:49:52 +0000 (15:49 +0000)
committerNathan Scott <nathans@sgi.com>
Thu, 18 May 2006 15:49:52 +0000 (15:49 +0000)
Merge of master-melb:xfs-cmds:25964a by kenmcd.

repair/phase6.c

index 5134282d3de09f47bc08abd64def3c285d714f70..5297c808129f96133753fc1975d27e74b469384b 100644 (file)
@@ -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 */