From 9ea254da296c88bd1374d4f43062b9bff4327b4b Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Mon, 14 Jan 2002 18:31:28 +0000 Subject: [PATCH] Don't try to zero last 64k on the device if the filesystem is in a regular file. --- mkfs/xfs_mkfs.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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. -- 2.47.2