From: Eric Sandeen Date: Mon, 14 Jan 2002 18:31:28 +0000 (+0000) Subject: Don't try to zero last 64k on the device if the filesystem is in a regular X-Git-Tag: v2.0.0~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ea254da296c88bd1374d4f43062b9bff4327b4b;p=thirdparty%2Fxfsprogs-dev.git Don't try to zero last 64k on the device if the filesystem is in a regular file. --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index deb604d85..4bfbcb0fc 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -1687,13 +1687,14 @@ main(int argc, char **argv) /* * Zero out the last 64k on the device, to obliterate any - * old MD RAID (or other) metadata at the end of the device + * old MD RAID (or other) metadata at the end of the device. */ - - buf = libxfs_getbuf(xi.ddev, (xi.dsize - BTOBB(65536)), - BTOBB(65536)); - bzero(XFS_BUF_PTR(buf), 65536); - libxfs_writebuf(buf, 1); + if (!xi.disfile) { + buf = libxfs_getbuf(xi.ddev, (xi.dsize - BTOBB(65536)), + BTOBB(65536)); + bzero(XFS_BUF_PTR(buf), 65536); + libxfs_writebuf(buf, 1); + } /* * Zero the log if there is one.