Message ID | 20250311080430.3696582-4-chao@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v3,1/6] common/config: remove redundant export variables | expand |
On Tue, Mar 11, 2025 at 04:04:28PM +0800, Chao Yu wrote: > Otherwise, mkfs will fail due to there is an existing filesystem > in the image. > > Cc: Jaegeuk Kim <jaegeuk@kernel.org> > Signed-off-by: Chao Yu <chao@kernel.org> > --- > v3: > - split change from f2fs/009, and cover both _scratch_mkfs() and > _try_scratch_mkfs_sized() Reviewed-by: Zorro Lang <zlang@redhat.com> > common/rc | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/common/rc b/common/rc > index ca755055..23b642f4 100644 > --- a/common/rc > +++ b/common/rc > @@ -993,7 +993,7 @@ _scratch_mkfs() > mkfs_filter="grep -v -e ^Warning: -e \"^mke2fs \"" > ;; > f2fs) > - mkfs_cmd="$MKFS_F2FS_PROG" > + mkfs_cmd="$MKFS_F2FS_PROG -f" > mkfs_filter="cat" > ;; > ocfs2) > @@ -1336,7 +1336,7 @@ _try_scratch_mkfs_sized() > f2fs) > # mkfs.f2fs requires # of sectors as an input for the size > local sector_size=`blockdev --getss $SCRATCH_DEV` > - $MKFS_F2FS_PROG $MKFS_OPTIONS "$@" $SCRATCH_DEV `expr $fssize / $sector_size` > + $MKFS_F2FS_PROG -f $MKFS_OPTIONS "$@" $SCRATCH_DEV `expr $fssize / $sector_size` > ;; > tmpfs) > local free_mem=`_free_memory_bytes` > -- > 2.48.1 > >
diff --git a/common/rc b/common/rc index ca755055..23b642f4 100644 --- a/common/rc +++ b/common/rc @@ -993,7 +993,7 @@ _scratch_mkfs() mkfs_filter="grep -v -e ^Warning: -e \"^mke2fs \"" ;; f2fs) - mkfs_cmd="$MKFS_F2FS_PROG" + mkfs_cmd="$MKFS_F2FS_PROG -f" mkfs_filter="cat" ;; ocfs2) @@ -1336,7 +1336,7 @@ _try_scratch_mkfs_sized() f2fs) # mkfs.f2fs requires # of sectors as an input for the size local sector_size=`blockdev --getss $SCRATCH_DEV` - $MKFS_F2FS_PROG $MKFS_OPTIONS "$@" $SCRATCH_DEV `expr $fssize / $sector_size` + $MKFS_F2FS_PROG -f $MKFS_OPTIONS "$@" $SCRATCH_DEV `expr $fssize / $sector_size` ;; tmpfs) local free_mem=`_free_memory_bytes`
Otherwise, mkfs will fail due to there is an existing filesystem in the image. Cc: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Chao Yu <chao@kernel.org> --- v3: - split change from f2fs/009, and cover both _scratch_mkfs() and _try_scratch_mkfs_sized() common/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)