Skip to contentSkip to conversation

resize2fs: remove unused variable 'c'

PATCH Applied Lukas Czerner 3 participants 7 messages Feb 17, 2022 – Apr 28, 2022 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 resize2fs: remove unused variable 'c'

---
 resize/resize2fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
resize/resize2fs.c +1 -1
index b9783e8c..d69cb01e 100644
@@ -2847,7 +2847,7 @@ static errcode_t resize2fs_calculate_summary_stats(ext2_filsys fs)
 	errcode_t	retval;
 	blk64_t		blk = fs->super->s_first_data_block;
 	ext2_ino_t	ino;
-	unsigned int	n, c, group, count;
+	unsigned int	n, group, count;
 	blk64_t		total_clusters_free = 0;
 	int		total_inodes_free = 0;
 	int		group_free = 0;
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/3 libss: fix possible NULL pointer dereferece on allocation failure

Currently in ss_execute_command() we're missng a check to see if the memory allocation was succesful. Fix it by adding SS_ET_ENOMEM error and checking the return from malloc.

---
 lib/ss/execute_cmd.c | 2 ++
 lib/ss/ss_err.et     | 3 +++
 2 files changed, 5 insertions(+)
lib/ss/execute_cmd.c +2 -0
index d443a468..0bcaa54d 100644
@@ -171,6 +171,8 @@ int ss_execute_command(int sci_idx, register char *argv[])
 	for (argp = argv; *argp; argp++)
 		argc++;
 	argp = (char **)malloc((argc+1)*sizeof(char *));
+	if (!argp)
+		return(SS_ET_ENOMEM);
 	for (i = 0; i <= argc; i++)
 		argp[i] = argv[i];
 	i = really_execute_command(sci_idx, argc, &argp);
lib/ss/ss_err.et +3 -0
index 80e9dfa4..f7238da0 100644
@@ -36,4 +36,7 @@ ec	SS_ET_ESCAPE_DISABLED,
 ec	SS_ET_UNIMPLEMENTED,
 	"Sorry, this request is not yet implemented"
 
+ec	SS_ET_ENOMEM,
+	"Not enough memory"
+
 	end
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/3 e2fsprogs: use mallinfo2 instead of mallinfo if available

In reply to Lukas Czerner

mallinfo has been deprecated with GNU C library version 2.33 in favor of mallinfo2 which works exactly the same as mallinfo but with larger field widths. Use mallinfo2 if available.

---
 configure               |  2 +-
 configure.ac            |  1 +
 e2fsck/iscan.c          | 11 ++++++++++-
 e2fsck/util.c           | 11 ++++++++++-
 lib/config.h.in         |  3 +++
 resize/resource_track.c | 13 ++++++++++---
 6 files changed, 35 insertions(+), 6 deletions(-)
configure +1 -1
index effd929d..530bc77c 100755
@@ -11254,7 +11254,7 @@ fi
 if test -n "$DLOPEN_LIB" ; then
    ac_cv_func_dlopen=yes
 fi
-for ac_func in  	__secure_getenv 	add_key 	backtrace 	chflags 	dlopen 	fadvise64 	fallocate 	fallocate64 	fchown 	fcntl 	fdatasync 	fstat64 	fsync 	ftruncate64 	futimes 	getcwd 	getdtablesize 	getentropy 	gethostname 	getmntinfo 	getpwuid_r 	getrandom 	getrlimit 	getrusage 	jrand48 	keyctl 	llistxattr 	llseek 	lseek64 	mallinfo 	mbstowcs 	memalign 	mempcpy 	mmap 	msync 	nanosleep 	open64 	pathconf 	posix_fadvise 	posix_fadvise64 	posix_memalign 	prctl 	pread 	pwrite 	pread64 	pwrite64 	secure_getenv 	setmntent 	setresgid 	setresuid 	snprintf 	srandom 	stpcpy 	strcasecmp 	strdup 	strnlen 	strptime 	strtoull 	sync_file_range 	sysconf 	usleep 	utime 	utimes 	valloc
+for ac_func in  	__secure_getenv 	add_key 	backtrace 	chflags 	dlopen 	fadvise64 	fallocate 	fallocate64 	fchown 	fcntl 	fdatasync 	fstat64 	fsync 	ftruncate64 	futimes 	getcwd 	getdtablesize 	getentropy 	gethostname 	getmntinfo 	getpwuid_r 	getrandom 	getrlimit 	getrusage 	jrand48 	keyctl 	llistxattr 	llseek 	lseek64 	mallinfo 	mallinfo2 	mbstowcs 	memalign 	mempcpy 	mmap 	msync 	nanosleep 	open64 	pathconf 	posix_fadvise 	posix_fadvise64 	posix_memalign 	prctl 	pread 	pwrite 	pread64 	pwrite64 	secure_getenv 	setmntent 	setresgid 	setresuid 	snprintf 	srandom 	stpcpy 	strcasecmp 	strdup 	strnlen 	strptime 	strtoull 	sync_file_range 	sysconf 	usleep 	utime 	utimes 	valloc
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
configure.ac +1 -0
index dff3d1ca..8acc4e1c 100644
@@ -1214,6 +1214,7 @@ AC_CHECK_FUNCS(m4_flatten([
 	llseek
 	lseek64
 	mallinfo
+	mallinfo2
 	mbstowcs
 	memalign
 	mempcpy
e2fsck/iscan.c +10 -1
index 607e4752..33c6a4cd 100644
@@ -109,7 +109,16 @@ void print_resource_track(const char *desc,
 		printf("%s: ", desc);
 
 #define kbytes(x)	(((unsigned long long)(x) + 1023) / 1024)
-#ifdef HAVE_MALLINFO
+#ifdef HAVE_MALLINFO2
+	if (1) {
+		struct mallinfo2 malloc_info = mallinfo2();
+
+		printf("Memory used: %lluk/%lluk (%lluk/%lluk), ",
+		       kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
+		       kbytes(malloc_info.uordblks),
+		       kbytes(malloc_info.fordblks));
+	} else
+#elif defined HAVE_MALLINFO
 	/* don't use mallinfo() if over 2GB used, since it returns "int" */
 	if ((char *)sbrk(0) - (char *)track->brk_start < 2LL << 30) {
 		struct mallinfo	malloc_info = mallinfo();
e2fsck/util.c +10 -1
index 3fe3c988..42740d9e 100644
@@ -430,7 +430,16 @@ void print_resource_track(e2fsck_t ctx, const char *desc,
 		log_out(ctx, "%s: ", desc);
 
 #define kbytes(x)	(((unsigned long long)(x) + 1023) / 1024)
-#ifdef HAVE_MALLINFO
+#ifdef HAVE_MALLINFO2
+	if (1) {
+		struct mallinfo2 malloc_info = mallinfo2();
+
+		log_out(ctx, _("Memory used: %lluk/%lluk (%lluk/%lluk), "),
+			kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
+			kbytes(malloc_info.uordblks),
+			kbytes(malloc_info.fordblks));
+	} else
+#elif defined HAVE_MALLINFO
 	/* don't use mallinfo() if over 2GB used, since it returns "int" */
 	if ((char *)sbrk(0) - (char *)track->brk_start < 2LL << 30) {
 		struct mallinfo	malloc_info = mallinfo();
lib/config.h.in +3 -0
index 9c9de65d..b5856bb5 100644
@@ -208,6 +208,9 @@
 /* Define to 1 if you have the `mallinfo' function. */
 #undef HAVE_MALLINFO
 
+/* Define to 1 if you have the `mallinfo2' function. */
+#undef HAVE_MALLINFO2
+
 /* Define to 1 if you have the <malloc.h> header file. */
 #undef HAVE_MALLOC_H
 
resize/resource_track.c +10 -3
index f0efe114..f4667060 100644
@@ -63,8 +63,10 @@ void print_resource_track(ext2_resize_t rfs, struct resource_track *track,
 #ifdef HAVE_GETRUSAGE
 	struct rusage r;
 #endif
-#ifdef HAVE_MALLINFO
-	struct mallinfo	malloc_info;
+#ifdef HAVE_MALLINFO2
+	struct mallinfo2 malloc_info;
+#elif defined HAVE_MALLINFO
+	struct mallinfo malloc_info;
 #endif
 	struct timeval time_end;
 
@@ -76,8 +78,13 @@ void print_resource_track(ext2_resize_t rfs, struct resource_track *track,
 	if (track->desc)
 		printf("%s: ", track->desc);
 
-#ifdef HAVE_MALLINFO
 #define kbytes(x)	(((unsigned long)(x) + 1023) / 1024)
+#ifdef HAVE_MALLINFO2
+	malloc_info = mallinfo2();
+	printf("Memory used: %luk/%luk (%luk/%luk), ",
+		kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
+		kbytes(malloc_info.uordblks), kbytes(malloc_info.fordblks));
+#elif defined HAVE_MALLINFO
 
 	malloc_info = mallinfo();
 	printf("Memory used: %luk/%luk (%luk/%luk), ",
Signature · 1 line
2.34.1
Reviewed-by on v1 3/3
#3 lore raw

Re: [PATCH 3/3] e2fsprogs: use mallinfo2 instead of mallinfo if available

Quoted 6 lines · Lukas Czerner

mallinfo has been deprecated with GNU C library version 2.33 in favor of mallinfo2 which works exactly the same as mallinfo but with larger field widths. Use mallinfo2 if available.

Nice that a replacement for mallinfo() API was finally added to glibc.

Quoted 125 lines

---

configure               |  2 +-
configure.ac            |  1 +
e2fsck/iscan.c          | 11 ++++++++++-
e2fsck/util.c           | 11 ++++++++++-
lib/config.h.in         |  3 +++
resize/resource_track.c | 13 ++++++++++---
6 files changed, 35 insertions(+), 6 deletions(-)
configure +0 -0
index effd929d..530bc77c 100755
@@ -11254,7 +11254,7 @@ fi

if test -n "$DLOPEN_LIB" ; then
ac_cv_func_dlopen=yes
fi

configure +1 -1
-for ac_func in  	__secure_getenv 	add_key 	backtrace 	chflags 	dlopen 	fadvise64 	fallocate 	fallocate64 	fchown 	fcntl 	fdatasync 	fstat64 	fsync 	ftruncate64 	futimes 	getcwd 	getdtablesize 	getentropy 	gethostname 	getmntinfo 	getpwuid_r 	getrandom 	getrlimit 	getrusage 	jrand48 	keyctl 	llistxattr 	llseek 	lseek64 	mallinfo 	mbstowcs 	memalign 	mempcpy 	mmap 	msync 	nanosleep 	open64 	pathconf 	posix_fadvise 	posix_fadvise64 	posix_memalign 	prctl 	pread 	pwrite 	pread64 	pwrite64 	secure_getenv 	setmntent 	setresgid 	setresuid 	snprintf 	srandom 	stpcpy 	strcasecmp 	strdup 	strnlen 	strptime 	strtoull 	sync_file_range 	sysconf 	usleep 	utime 	utimes 	valloc
+for ac_func in  	__secure_getenv 	add_key 	backtrace 	chflags 	dlopen 	fadvise64 	fallocate 	fallocate64 	fchown 	fcntl 	fdatasync 	fstat64 	fsync 	ftruncate64 	futimes 	getcwd 	getdtablesize 	getentropy 	gethostname 	getmntinfo 	getpwuid_r 	getrandom 	getrlimit 	getrusage 	jrand48 	keyctl 	llistxattr 	llseek 	lseek64 	mallinfo 	mallinfo2 	mbstowcs 	memalign 	mempcpy 	mmap 	msync 	nanosleep 	open64 	pathconf 	posix_fadvise 	posix_fadvise64 	posix_memalign 	prctl 	pread 	pwrite 	pread64 	pwrite64 	secure_getenv 	setmntent 	setresgid 	setresuid 	snprintf 	srandom 	stpcpy 	strcasecmp 	strdup 	strnlen 	strptime 	strtoull 	sync_file_range 	sysconf 	usleep 	utime 	utimes 	valloc

do :
as_ac_var=$as_echo "ac_cv_func_$ac_func" | $as_tr_sh
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

configure.ac +1 -0
index dff3d1ca..8acc4e1c 100644
@@ -1214,6 +1214,7 @@ AC_CHECK_FUNCS(m4_flatten([
 	llseek
 	lseek64
 	mallinfo
+	mallinfo2
 	mbstowcs
 	memalign
 	mempcpy
e2fsck/iscan.c +10 -1
index 607e4752..33c6a4cd 100644
@@ -109,7 +109,16 @@ void print_resource_track(const char *desc,
 		printf("%s: ", desc);
 
 #define kbytes(x)	(((unsigned long long)(x) + 1023) / 1024)
-#ifdef HAVE_MALLINFO
+#ifdef HAVE_MALLINFO2
+	if (1) {
+		struct mallinfo2 malloc_info = mallinfo2();
+
+		printf("Memory used: %lluk/%lluk (%lluk/%lluk), ",
+		       kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
+		       kbytes(malloc_info.uordblks),
+		       kbytes(malloc_info.fordblks));
+	} else
+#elif defined HAVE_MALLINFO
 	/* don't use mallinfo() if over 2GB used, since it returns "int" */
 	if ((char *)sbrk(0) - (char *)track->brk_start < 2LL << 30) {
 		struct mallinfo	malloc_info = mallinfo();
e2fsck/util.c +10 -1
index 3fe3c988..42740d9e 100644
@@ -430,7 +430,16 @@ void print_resource_track(e2fsck_t ctx, const char *desc,
 		log_out(ctx, "%s: ", desc);
 
 #define kbytes(x)	(((unsigned long long)(x) + 1023) / 1024)
-#ifdef HAVE_MALLINFO
+#ifdef HAVE_MALLINFO2
+	if (1) {
+		struct mallinfo2 malloc_info = mallinfo2();
+
+		log_out(ctx, _("Memory used: %lluk/%lluk (%lluk/%lluk), "),
+			kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
+			kbytes(malloc_info.uordblks),
+			kbytes(malloc_info.fordblks));
+	} else
+#elif defined HAVE_MALLINFO
 	/* don't use mallinfo() if over 2GB used, since it returns "int" */
 	if ((char *)sbrk(0) - (char *)track->brk_start < 2LL << 30) {
 		struct mallinfo	malloc_info = mallinfo();
lib/config.h.in +3 -0
index 9c9de65d..b5856bb5 100644
@@ -208,6 +208,9 @@
 /* Define to 1 if you have the `mallinfo' function. */
 #undef HAVE_MALLINFO
 
+/* Define to 1 if you have the `mallinfo2' function. */
+#undef HAVE_MALLINFO2
+
 /* Define to 1 if you have the <malloc.h> header file. */
 #undef HAVE_MALLOC_H
 
resize/resource_track.c +10 -4
index f0efe114..f4667060 100644
@@ -63,8 +63,10 @@ void print_resource_track(ext2_resize_t rfs, struct resource_track *track,
 #ifdef HAVE_GETRUSAGE
 	struct rusage r;
 #endif
-#ifdef HAVE_MALLINFO
-	struct mallinfo	malloc_info;
+#ifdef HAVE_MALLINFO2
+	struct mallinfo2 malloc_info;
+#elif defined HAVE_MALLINFO
+	struct mallinfo malloc_info;
 #endif
 	struct timeval time_end;
 
@@ -76,8 +78,13 @@ void print_resource_track(ext2_resize_t rfs, struct resource_track *track,
 	if (track->desc)
 		printf("%s: ", track->desc);
 
-#ifdef HAVE_MALLINFO
 #define kbytes(x)	(((unsigned long)(x) + 1023) / 1024)
+#ifdef HAVE_MALLINFO2
+	malloc_info = mallinfo2();
+	printf("Memory used: %luk/%luk (%luk/%luk), ",
+		kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
+		kbytes(malloc_info.uordblks), kbytes(malloc_info.fordblks));
+#elif defined HAVE_MALLINFO
 
 	malloc_info = mallinfo();
 	printf("Memory used: %luk/%luk (%luk/%luk), ",
--
Quoted 2 lines

2.34.1

Cheers, Andreas

Reviewed-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] e2fsprogs: use mallinfo2 instead of mallinfo if available

In reply to Lukas Czerner
Quoted 6 lines · Lukas Czerner

mallinfo has been deprecated with GNU C library version 2.33 in favor of mallinfo2 which works exactly the same as mallinfo but with larger field widths. Use mallinfo2 if available.

Quoted 125 lines

---

configure               |  2 +-
configure.ac            |  1 +
e2fsck/iscan.c          | 11 ++++++++++-
e2fsck/util.c           | 11 ++++++++++-
lib/config.h.in         |  3 +++
resize/resource_track.c | 13 ++++++++++---
6 files changed, 35 insertions(+), 6 deletions(-)
configure +0 -0
index effd929d..530bc77c 100755
@@ -11254,7 +11254,7 @@ fi

if test -n "$DLOPEN_LIB" ; then
ac_cv_func_dlopen=yes
fi

configure +1 -1
-for ac_func in  	__secure_getenv 	add_key 	backtrace 	chflags 	dlopen 	fadvise64 	fallocate 	fallocate64 	fchown 	fcntl 	fdatasync 	fstat64 	fsync 	ftruncate64 	futimes 	getcwd 	getdtablesize 	getentropy 	gethostname 	getmntinfo 	getpwuid_r 	getrandom 	getrlimit 	getrusage 	jrand48 	keyctl 	llistxattr 	llseek 	lseek64 	mallinfo 	mbstowcs 	memalign 	mempcpy 	mmap 	msync 	nanosleep 	open64 	pathconf 	posix_fadvise 	posix_fadvise64 	posix_memalign 	prctl 	pread 	pwrite 	pread64 	pwrite64 	secure_getenv 	setmntent 	setresgid 	setresuid 	snprintf 	srandom 	stpcpy 	strcasecmp 	strdup 	strnlen 	strptime 	strtoull 	sync_file_range 	sysconf 	usleep 	utime 	utimes 	valloc
+for ac_func in  	__secure_getenv 	add_key 	backtrace 	chflags 	dlopen 	fadvise64 	fallocate 	fallocate64 	fchown 	fcntl 	fdatasync 	fstat64 	fsync 	ftruncate64 	futimes 	getcwd 	getdtablesize 	getentropy 	gethostname 	getmntinfo 	getpwuid_r 	getrandom 	getrlimit 	getrusage 	jrand48 	keyctl 	llistxattr 	llseek 	lseek64 	mallinfo 	mallinfo2 	mbstowcs 	memalign 	mempcpy 	mmap 	msync 	nanosleep 	open64 	pathconf 	posix_fadvise 	posix_fadvise64 	posix_memalign 	prctl 	pread 	pwrite 	pread64 	pwrite64 	secure_getenv 	setmntent 	setresgid 	setresuid 	snprintf 	srandom 	stpcpy 	strcasecmp 	strdup 	strnlen 	strptime 	strtoull 	sync_file_range 	sysconf 	usleep 	utime 	utimes 	valloc

do :
as_ac_var=$as_echo "ac_cv_func_$ac_func" | $as_tr_sh
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

configure.ac +1 -0
index dff3d1ca..8acc4e1c 100644
@@ -1214,6 +1214,7 @@ AC_CHECK_FUNCS(m4_flatten([
 	llseek
 	lseek64
 	mallinfo
+	mallinfo2
 	mbstowcs
 	memalign
 	mempcpy
e2fsck/iscan.c +10 -1
index 607e4752..33c6a4cd 100644
@@ -109,7 +109,16 @@ void print_resource_track(const char *desc,
 		printf("%s: ", desc);
 
 #define kbytes(x)	(((unsigned long long)(x) + 1023) / 1024)
-#ifdef HAVE_MALLINFO
+#ifdef HAVE_MALLINFO2
+	if (1) {
+		struct mallinfo2 malloc_info = mallinfo2();
+
+		printf("Memory used: %lluk/%lluk (%lluk/%lluk), ",
+		       kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
+		       kbytes(malloc_info.uordblks),
+		       kbytes(malloc_info.fordblks));
+	} else
+#elif defined HAVE_MALLINFO
 	/* don't use mallinfo() if over 2GB used, since it returns "int" */
 	if ((char *)sbrk(0) - (char *)track->brk_start < 2LL << 30) {
 		struct mallinfo	malloc_info = mallinfo();
e2fsck/util.c +10 -1
index 3fe3c988..42740d9e 100644
@@ -430,7 +430,16 @@ void print_resource_track(e2fsck_t ctx, const char *desc,
 		log_out(ctx, "%s: ", desc);
 
 #define kbytes(x)	(((unsigned long long)(x) + 1023) / 1024)
-#ifdef HAVE_MALLINFO
+#ifdef HAVE_MALLINFO2
+	if (1) {
+		struct mallinfo2 malloc_info = mallinfo2();
+
+		log_out(ctx, _("Memory used: %lluk/%lluk (%lluk/%lluk), "),
+			kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
+			kbytes(malloc_info.uordblks),
+			kbytes(malloc_info.fordblks));
+	} else
+#elif defined HAVE_MALLINFO
 	/* don't use mallinfo() if over 2GB used, since it returns "int" */
 	if ((char *)sbrk(0) - (char *)track->brk_start < 2LL << 30) {
 		struct mallinfo	malloc_info = mallinfo();
lib/config.h.in +3 -0
index 9c9de65d..b5856bb5 100644
@@ -208,6 +208,9 @@
 /* Define to 1 if you have the `mallinfo' function. */
 #undef HAVE_MALLINFO
 
+/* Define to 1 if you have the `mallinfo2' function. */
+#undef HAVE_MALLINFO2
+
 /* Define to 1 if you have the <malloc.h> header file. */
 #undef HAVE_MALLOC_H
 
resize/resource_track.c +10 -4
index f0efe114..f4667060 100644
@@ -63,8 +63,10 @@ void print_resource_track(ext2_resize_t rfs, struct resource_track *track,
 #ifdef HAVE_GETRUSAGE
 	struct rusage r;
 #endif
-#ifdef HAVE_MALLINFO
-	struct mallinfo	malloc_info;
+#ifdef HAVE_MALLINFO2
+	struct mallinfo2 malloc_info;
+#elif defined HAVE_MALLINFO
+	struct mallinfo malloc_info;
 #endif
 	struct timeval time_end;
 
@@ -76,8 +78,13 @@ void print_resource_track(ext2_resize_t rfs, struct resource_track *track,
 	if (track->desc)
 		printf("%s: ", track->desc);
 
-#ifdef HAVE_MALLINFO
 #define kbytes(x)	(((unsigned long)(x) + 1023) / 1024)
+#ifdef HAVE_MALLINFO2
+	malloc_info = mallinfo2();
+	printf("Memory used: %luk/%luk (%luk/%luk), ",
+		kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
+		kbytes(malloc_info.uordblks), kbytes(malloc_info.fordblks));
+#elif defined HAVE_MALLINFO
 
 	malloc_info = mallinfo();
 	printf("Memory used: %luk/%luk (%luk/%luk), ",
--
Quoted 2 lines

2.34.1

Cheers, Andreas

Reviewed-by on v1 1/3
#5 lore raw
In reply to Lukas Czerner
Quoted 2 lines · Lukas Czerner
Quoted 18 lines

---
resize/resize2fs.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
resize/resize2fs.c +1 -2
index b9783e8c..d69cb01e 100644
@@ -2847,7 +2847,7 @@ static errcode_t resize2fs_calculate_summary_stats(ext2_filsys fs)
 	errcode_t	retval;
 	blk64_t		blk = fs->super->s_first_data_block;
 	ext2_ino_t	ino;
-	unsigned int	n, c, group, count;
+	unsigned int	n, group, count;
 	blk64_t		total_clusters_free = 0;
 	int		total_inodes_free = 0;
 	int		group_free = 0;
--
Quoted 2 lines

2.34.1

Cheers, Andreas

#6 lore raw
In reply to Lukas Czerner

Applied, thanks!

I did make a minor change in the libss patch; there's no need to create a new error code, SS_ET_ENOMEM; we can just return the standard ENOMEM error.

[1/3] resize2fs: remove unused variable 'c'

      commit: 997902106fab2bc7cb0f7251eb55fad4b721b51a
[2/3] libss: fix possible NULL pointer dereferece on allocation failure
      commit: a282671a02e8fffa04ac0f9db7982fd6bb0a0916
[3/3] e2fsprogs: use mallinfo2 instead of mallinfo if available
      commit: 97079a792dd5e9ea9d4708d2e80244c930a139cd

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>