From: Christoph Hellwig Date: Mon, 11 Dec 2023 16:37:36 +0000 (+0100) Subject: libxfs: remove dead size < 0 checks in libxfs_init X-Git-Tag: v6.6.0~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f735961188fce99ac70a605bd7f5046accb5da2b;p=thirdparty%2Fxfsprogs-dev.git libxfs: remove dead size < 0 checks in libxfs_init libxfs_init initializes the device size to 0 at the start of the function and libxfs_open_device never sets the size to a negativ value. Remove these checks as they are dead code. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Carlos Maiolino Signed-off-by: Carlos Maiolino --- diff --git a/libxfs/init.c b/libxfs/init.c index 5be6f8cf1..87193c3a6 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -329,21 +329,6 @@ libxfs_init(struct libxfs_init *a) platform_findsizes(dname, a->rtfd, &a->rtsize, &a->rtbsize); } - if (a->dsize < 0) { - fprintf(stderr, _("%s: can't get size for data subvolume\n"), - progname); - goto done; - } - if (a->logBBsize < 0) { - fprintf(stderr, _("%s: can't get size for log subvolume\n"), - progname); - goto done; - } - if (a->rtsize < 0) { - fprintf(stderr, _("%s: can't get size for realtime subvolume\n"), - progname); - goto done; - } if (!libxfs_bhash_size) libxfs_bhash_size = LIBXFS_BHASHSIZE(sbp); libxfs_bcache = cache_init(a->bcache_flags, libxfs_bhash_size,