瀏覽代碼

fs/btrfs: remove destination file before generation

btrfs will happily use an existing destination file if it
already exists, increasing its size if needed. Hoever, it
will never decrease the size, even if the requested size
is smaller than the existing file.

So, remove any previously existing destination file before
generating the new filesystem.

Note: the original submission by Robert did that, but as
this case was not obvious, the removal was dropped by a
refactoring when the patch was initially applied.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Robert J. Heywood <robert.heywood@codethink.co.uk>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[Thomas: use $@ instead of $(@), use $(RM) instead of rm.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Yann E. MORIN 5 年之前
父節點
當前提交
f023810f04
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      fs/btrfs/btrfs.mk

+ 1 - 0
fs/btrfs/btrfs.mk

@@ -29,6 +29,7 @@ BTRFS_OPTS = \
 ROOTFS_BTRFS_DEPENDENCIES = host-btrfs-progs
 
 define ROOTFS_BTRFS_CMD
+	$(RM) -f $@
 	$(HOST_DIR)/bin/mkfs.btrfs $(BTRFS_OPTS) $@
 endef