]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
do the same thing as db/check.c in the situation where we can't read
authorNathan Scott <nathans@sgi.com>
Mon, 3 Sep 2001 07:18:05 +0000 (07:18 +0000)
committerNathan Scott <nathans@sgi.com>
Mon, 3 Sep 2001 07:18:05 +0000 (07:18 +0000)
one of a btree's blocks - warn, then continue; don't take a segv.

db/freesp.c
doc/CHANGES
mkfile/xfs_mkfile.c

index 160d2360c7195559697a6be8f9e4389c48cbd279..7a6becfd4c5b049c3d20e225d2660cd47fab9003 100644 (file)
@@ -282,10 +282,15 @@ scan_sbtree(
                                int                     level,
                                xfs_agf_t               *agf))
 {
+       xfs_agnumber_t  seqno = INT_GET(agf->agf_seqno, ARCH_CONVERT);
+
        push_cur();
-       set_cur(&typtab[typ],
-               XFS_AGB_TO_DADDR(mp, INT_GET(agf->agf_seqno, ARCH_CONVERT), root),
+       set_cur(&typtab[typ], XFS_AGB_TO_DADDR(mp, seqno, root),
                blkbb, DB_RING_IGN, NULL);
+       if (iocur_top->data == NULL) {
+               dbprintf("can't read btree block %u/%u\n", seqno, root);
+                return;
+       }
        (*func)((xfs_btree_sblock_t *)iocur_top->data, typ, nlevels - 1, agf);
        pop_cur();
 }
index 28ac50cc328f1004ecc3f5eb616e885fbefd4f15..965958c15f291b9df2943d1acabc49dd86f24964 100644 (file)
@@ -1,3 +1,7 @@
+xfsprogs-current
+       - enable preallocation in xfs_mkfile [missed during port?]
+       - fix xfs_db core dump when reporting freespace
+
 xfsprogs-1.3.6 (31 August 2001)
        - make mkfs.xfs aware of geometries that might cause
          inode numbers to exceed 32 significant bits.
index 6903a83500f775db02a11f62b6d6027064f87f41..1957b4da7f98c2bc4cad653afbcbea9e28516d34 100644 (file)
@@ -184,21 +184,8 @@ main(int argc, char **argv)
                        flck.l_whence = SEEK_SET;
                        flck.l_start  = 0LL;
                        flck.l_len    = size;
-#if 0
-                       (void)ioctl(fd, XFS_IOC_RESVSP64, &flck);
-
-                       if (prealloc) {
-                               if ( close(fd) < 0 ) {
-                                       perror(argv[optind]);
-                                       unlink(argv[optind]);
-                                       errs++;
-                               }
-
-                               optind++;
-
-                               continue;
-                       }
-#endif
+                       if (prealloc)
+                               (void)ioctl(fd, XFS_IOC_RESVSP64, &flck);
                        if (oflags & O_DIRECT) {
                                nbufalign = da.d_mem;