Hi Daniel,

Because of this issue I'm running out of free space on nilfs partition so I 
couldn't wait any longer and prepared a NMU.
(I hope you'll excuse me for this)

Feel free to grab source package (using 'dget -ux' command) from

http://mentors.debian.net/debian/pool/main/n/nilfs-tools/nilfs-tools_2.1.1-0.1.dsc

NMU introduces the following changes:

  * New Upstream Release
  * Build with libmount (Closes: #656151)
  * Use DPKG-provided build flags & hardening
  * Added debian/watch

Please note that this is a source package and it is not being uploaded unless 
someone is willing to sponsor.
I'm sure changes are easy enough to integrate but those who need solution right 
away might use this package.

(Just in case I'm attaching debdiff output.)

I will be happy co-maintain if you don't mind a bit of help.

Thank you.

Regards,
Dmitry.
diff -Nru nilfs-tools-2.1.0/AUTHORS nilfs-tools-2.1.1/AUTHORS
--- nilfs-tools-2.1.0/AUTHORS	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/AUTHORS	2012-01-14 20:43:06.000000000 +1100
@@ -35,6 +35,16 @@
 - Initial development
 
 Other contributors:
+* Dan McGee <d...@archlinux.org>
+Dec 21, 2011: bunch of fixes and cleanups including:
+    - corrected error code propagation of umount.nilfs2 (libmount version)
+    - improved error message for permission failure of rmcp command
+    - sanity check for positive checkpoint number
+    - proper parser routine use for 64-bit integer inputs
+    - removal of kern_compat.h
+    - and so forth.
+Jan 5, 2012: add -h command line option to mkfs.nilfs2
+
 * David Arendt <ad...@prnet.org>
 March 29, 2010: added cleaning functions based on the number of free segments
 March 29, 2010: added mount option to disable garbage collection
diff -Nru nilfs-tools-2.1.0/bin/chcp.c nilfs-tools-2.1.1/bin/chcp.c
--- nilfs-tools-2.1.0/bin/chcp.c	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/bin/chcp.c	2012-01-14 20:43:06.000000000 +1100
@@ -49,6 +49,7 @@
 #include <errno.h>
 #include <signal.h>
 #include "nilfs.h"
+#include "cno.h"
 
 
 #define CHCP_MODE_CP	"cp"
@@ -121,7 +122,7 @@
 		dev = NULL;
 	} else {
 		modestr = argv[optind++];
-		strtoul(argv[optind], &endptr, CHCP_BASE);
+		nilfs_parse_cno(argv[optind], &endptr, CHCP_BASE);
 		if (*endptr == '\0')
 			dev = NULL;
 		else
@@ -178,8 +179,8 @@
 			break;
 		}
 
-		cno = strtoul(argv[optind], &endptr, CHCP_BASE);
-		if (*endptr != '\0') {
+		cno = nilfs_parse_cno(argv[optind], &endptr, CHCP_BASE);
+		if (cno >= NILFS_CNO_MAX || *endptr != '\0') {
 			fprintf(stderr, "%s: %s: invalid checkpoint number\n",
 				progname, argv[optind]);
 			status = 1;
diff -Nru nilfs-tools-2.1.0/bin/dumpseg.c nilfs-tools-2.1.1/bin/dumpseg.c
--- nilfs-tools-2.1.0/bin/dumpseg.c	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/bin/dumpseg.c	2012-01-14 20:43:06.000000000 +1100
@@ -211,7 +211,7 @@
 		fprintf(stderr, "%s: too few arguments\n", progname);
 		exit(1);
 	} else {
-		strtoul(argv[optind], &endptr, DUMPSEG_BASE);
+		strtoull(argv[optind], &endptr, DUMPSEG_BASE);
 		if (*endptr == '\0')
 			dev = NULL;
 		else
@@ -229,7 +229,7 @@
 
 	status = 0;
 	for (i = optind; i < argc; i++) {
-		segnum = strtoul(argv[i], &endptr, DUMPSEG_BASE);
+		segnum = strtoull(argv[i], &endptr, DUMPSEG_BASE);
 		if (*endptr != '\0') {
 			fprintf(stderr, "%s: %s: invalid segment number\n",
 				progname, argv[i]);
diff -Nru nilfs-tools-2.1.0/bin/Makefile.am nilfs-tools-2.1.1/bin/Makefile.am
--- nilfs-tools-2.1.0/bin/Makefile.am	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/bin/Makefile.am	2012-01-14 20:43:06.000000000 +1100
@@ -7,7 +7,7 @@
 bin_PROGRAMS = chcp dumpseg lscp lssu mkcp rmcp
 
 chcp_SOURCES = chcp.c
-chcp_LDADD = $(LDADD) $(LIB_POSIX_SEM)
+chcp_LDADD = $(LDADD) $(LIB_POSIX_SEM) $(top_builddir)/lib/libcno.la
 
 dumpseg_SOURCES = dumpseg.c
 
diff -Nru nilfs-tools-2.1.0/bin/Makefile.in nilfs-tools-2.1.1/bin/Makefile.in
--- nilfs-tools-2.1.0/bin/Makefile.in	2011-11-24 02:35:21.000000000 +1100
+++ nilfs-tools-2.1.1/bin/Makefile.in	2012-01-14 21:36:17.000000000 +1100
@@ -49,7 +49,8 @@
 am_chcp_OBJECTS = chcp.$(OBJEXT)
 chcp_OBJECTS = $(am_chcp_OBJECTS)
 am__DEPENDENCIES_1 =
-chcp_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1)
+chcp_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \
+	$(top_builddir)/lib/libcno.la
 am_dumpseg_OBJECTS = dumpseg.$(OBJEXT)
 dumpseg_OBJECTS = $(am_dumpseg_OBJECTS)
 dumpseg_LDADD = $(LDADD)
@@ -204,7 +205,7 @@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 LDADD = $(top_builddir)/lib/libnilfs.la
 chcp_SOURCES = chcp.c
-chcp_LDADD = $(LDADD) $(LIB_POSIX_SEM)
+chcp_LDADD = $(LDADD) $(LIB_POSIX_SEM) $(top_builddir)/lib/libcno.la
 dumpseg_SOURCES = dumpseg.c
 lscp_SOURCES = lscp.c
 lssu_SOURCES = lssu.c
diff -Nru nilfs-tools-2.1.0/bin/rmcp.c nilfs-tools-2.1.1/bin/rmcp.c
--- nilfs-tools-2.1.0/bin/rmcp.c	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/bin/rmcp.c	2012-01-14 20:43:06.000000000 +1100
@@ -105,7 +105,7 @@
 			nd++;
 			continue;
 		}
-		if (errno == EBUSY || errno == EPERM) {
+		if (errno == EBUSY) {
 			nss++;
 			if (!force) {
 				fprintf(stderr,
@@ -115,7 +115,10 @@
 		} else if (errno == ENOENT) {
 			nocp++;
 		} else {
-			fprintf(stderr, "%s: %s\n", progname, strerror(errno));
+			fprintf(stderr,
+				"%s: %llu: cannot remove checkpoint: %s\n",
+				progname, (unsigned long long)cno,
+				strerror(errno));
 			ret = -1;
 			goto out;
 		}
@@ -237,8 +240,10 @@
 			continue;
 
 		status = 1;
-		if (ret < 0)
+		if (ret < 0) {
+			fprintf(stderr, "Remaining checkpoints were not removed.\n");
 			break;
+		}
 
 		if (force || ndel != 0 || end - start + 1 - nss == 0)
 			continue;
diff -Nru nilfs-tools-2.1.0/ChangeLog nilfs-tools-2.1.1/ChangeLog
--- nilfs-tools-2.1.0/ChangeLog	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/ChangeLog	2012-01-14 20:43:06.000000000 +1100
@@ -1,3 +1,15 @@
+nilfs-utils-2.1.1  Sat Jan 14, 2012 JST
+
+	* umount.nilfs2 (libmount): send proper error code to complain function
+	* rmcp: print sensible error message on permission failure
+	* nilfs-tune: catch and handle missing device argument
+	* correct parser function use for 64-bit integer inputs
+	* rmcp/chcp: sanity check for positive checkpoint number
+	* mkfs.nilfs2: support -h command line option
+	* Add .gitignore rules for generated binaries
+	* Remove kern_compat.h
+	* cleanups
+
 nilfs-utils-2.1.0  Wed Nov 23, 2011 JST
 
 	* fix build error due to missing dependency to myrealpath library
@@ -203,7 +215,7 @@
 	* cleanerd uses a sequence counter instead of volatile active
 	  state of segments to checks whether a given segment is not
 	  unreclaimable.
-	
+
 nilfs-utils-2.0.7  Wed Feb 11, 2009 JST
 
 	* fix possible infinite loop in lscp.
@@ -242,7 +254,7 @@
 	* apply the patch that renames a member prefix of struct nilfs_suinfo
 	  in nilfs_fs.h, which was required to avoid a compile-time error
 	  of the nilfs2 kernel module on IA64 machines.
-	
+
 nilfs-utils-2.0.3  Thu May 22, 2008 JST
 
 	* fix the problem of 'make dist-bzip2' that it produces a tarball
@@ -284,10 +296,10 @@
 nilfs-utils-2.0.0-testing-8  Thu Dec 27, 2007 JST
 
 nilfs-utils-2.0.0-testing-7  Thu Nov 29, 2007 JST
-	
+
 	* add cast for 64bit environment.
 	* modify some error messages.
-	
+
 nilfs-utils-2.0.0-testing-6  Mon Oct 22, 2007 JST
 
 	* Changed the message of "No such device" error printed by mount.nilfs2
@@ -314,12 +326,12 @@
 	  Signed-off-by: Thomas Petazzoni <thomas.petazz...@enix.org>
 
 nilfs-utils-2.0.0-testing-2  Tue Jun 20, 2007 JST
-	
+
 	* Fixed a problem that the lscp and other userland tools might
 	  fail on Ubuntu 6 if a samba mounted partition exists.
 
 nilfs-utils-2.0.0-testing  Wed Jun 13, 2007 JST
-	
+
 	* The first release.
 	* Implemented the Garbage Collector.
 	* Rewrote almost all of the source code.
diff -Nru nilfs-tools-2.1.0/config.h.in nilfs-tools-2.1.1/config.h.in
--- nilfs-tools-2.1.0/config.h.in	2011-11-24 02:35:20.000000000 +1100
+++ nilfs-tools-2.1.1/config.h.in	2012-01-14 21:36:16.000000000 +1100
@@ -72,7 +72,7 @@
 /* Define to 1 if you have the <libmount/libmount.h> header file. */
 #undef HAVE_LIBMOUNT_LIBMOUNT_H
 
-/* Define to 1 if you have the `uuid' library (-luuid). */
+/* Define to 1 if you have the 'uuid' library (-luuid). */
 #undef HAVE_LIBUUID
 
 /* Define to 1 if you have the <limits.h> header file. */
@@ -175,6 +175,9 @@
 /* Define to 1 if you have the `strtoul' function. */
 #undef HAVE_STRTOUL
 
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
+
 /* Define to 1 if you have the <syslog.h> header file. */
 #undef HAVE_SYSLOG_H
 
diff -Nru nilfs-tools-2.1.0/configure nilfs-tools-2.1.1/configure
--- nilfs-tools-2.1.0/configure	2011-11-24 02:35:23.000000000 +1100
+++ nilfs-tools-2.1.1/configure	2012-01-14 21:36:19.000000000 +1100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for NILFS utils 2.1.0.
+# Generated by GNU Autoconf 2.61 for NILFS utils 2.1.1.
 #
 # Report bugs to <linux-ni...@vger.kernel.org>.
 #
@@ -728,8 +728,8 @@
 # Identity of this package.
 PACKAGE_NAME='NILFS utils'
 PACKAGE_TARNAME='nilfs-utils'
-PACKAGE_VERSION='2.1.0'
-PACKAGE_STRING='NILFS utils 2.1.0'
+PACKAGE_VERSION='2.1.1'
+PACKAGE_STRING='NILFS utils 2.1.1'
 PACKAGE_BUGREPORT='linux-ni...@vger.kernel.org'
 
 ac_unique_file="config.h.in"
@@ -1401,7 +1401,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures NILFS utils 2.1.0 to adapt to many kinds of systems.
+\`configure' configures NILFS utils 2.1.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1471,7 +1471,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of NILFS utils 2.1.0:";;
+     short | recursive ) echo "Configuration of NILFS utils 2.1.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1576,7 +1576,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-NILFS utils configure 2.1.0
+NILFS utils configure 2.1.1
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1590,7 +1590,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by NILFS utils $as_me 2.1.0, which was
+It was created by NILFS utils $as_me 2.1.1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2280,7 +2280,7 @@
 
 # Define the identity of the package.
  PACKAGE='nilfs-utils'
- VERSION='2.1.0'
+ VERSION='2.1.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -25134,9 +25134,10 @@
 
 
 
-for ac_func in alarm atexit ftruncate getcwd gettimeofday localtime_r \
-		memmove memset munmap strchr strdup strerror strrchr strstr \
-		strtoul getgrgid getpwuid strcasecmp getmntent_r strtok_r
+
+for ac_func in alarm atexit ftruncate getcwd getgrgid getmntent_r getpwuid \
+		gettimeofday localtime_r memmove memset munmap strcasecmp strchr \
+		strdup strerror strrchr strstr strtok_r strtoul strtoull
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -26017,7 +26018,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by NILFS utils $as_me 2.1.0, which was
+This file was extended by NILFS utils $as_me 2.1.1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -26070,7 +26071,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-NILFS utils config.status 2.1.0
+NILFS utils config.status 2.1.1
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff -Nru nilfs-tools-2.1.0/configure.ac nilfs-tools-2.1.1/configure.ac
--- nilfs-tools-2.1.0/configure.ac	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/configure.ac	2012-01-14 20:43:06.000000000 +1100
@@ -6,7 +6,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.60)
-AC_INIT(NILFS utils, 2.1.0, linux-ni...@vger.kernel.org)
+AC_INIT(NILFS utils, 2.1.1, linux-ni...@vger.kernel.org)
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])
@@ -37,7 +37,7 @@
 # Checks for libraries.
 AC_CHECK_LIB([uuid], [uuid_generate],
 	[AC_DEFINE([HAVE_LIBUUID], 1,
-	  [Define to 1 if you have the `uuid' library (-luuid).])],
+	  [Define to 1 if you have the 'uuid' library (-luuid).])],
 	[AC_MSG_ERROR([UUID library not found])])
 
 LIB_POSIX_MQ=''
@@ -101,9 +101,9 @@
 AC_FUNC_VPRINTF
 AC_CHECK_FUNC(posix_memalign,,
 	      [AC_MSG_ERROR([cannot find posix_memalign() function])])
-AC_CHECK_FUNCS([alarm atexit ftruncate getcwd gettimeofday localtime_r \
-		memmove memset munmap strchr strdup strerror strrchr strstr \
-		strtoul getgrgid getpwuid strcasecmp getmntent_r strtok_r])
+AC_CHECK_FUNCS([alarm atexit ftruncate getcwd getgrgid getmntent_r getpwuid \
+		gettimeofday localtime_r memmove memset munmap strcasecmp strchr \
+		strdup strerror strrchr strstr strtok_r strtoul strtoull])
 
 # Checks for system services
 AC_SYS_LARGEFILE
diff -Nru nilfs-tools-2.1.0/debian/changelog nilfs-tools-2.1.1/debian/changelog
--- nilfs-tools-2.1.0/debian/changelog	2011-11-29 06:21:03.000000000 +1100
+++ nilfs-tools-2.1.1/debian/changelog	2012-01-21 19:07:37.000000000 +1100
@@ -1,3 +1,13 @@
+nilfs-tools (2.1.1-0.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * New Upstream Release
+  * Build with libmount (Closes: #656151)
+  * Use DPKG-provided build flags & hardening
+  * Added debian/watch
+
+ -- Dmitry Smirnov <only...@member.fsf.org>  Sat, 21 Jan 2012 18:36:31 +1100
+
 nilfs-tools (2.1.0-1) unstable; urgency=low
 
   * Merging upstream version 2.1.0.
diff -Nru nilfs-tools-2.1.0/debian/control nilfs-tools-2.1.1/debian/control
--- nilfs-tools-2.1.0/debian/control	2011-11-29 06:20:23.000000000 +1100
+++ nilfs-tools-2.1.1/debian/control	2012-01-21 18:47:55.000000000 +1100
@@ -2,7 +2,7 @@
 Section: admin
 Priority: optional
 Maintainer: Daniel Baumann <daniel.baum...@progress-technologies.net>
-Build-Depends: debhelper (>= 8), autotools-dev, uuid-dev
+Build-Depends: debhelper (>= 8), autotools-dev, uuid-dev, libmount-dev
 Standards-Version: 3.9.2
 Homepage: http://www.nilfs.org/
 
diff -Nru nilfs-tools-2.1.0/debian/rules nilfs-tools-2.1.1/debian/rules
--- nilfs-tools-2.1.0/debian/rules	2011-11-29 06:20:23.000000000 +1100
+++ nilfs-tools-2.1.1/debian/rules	2012-01-21 18:51:38.000000000 +1100
@@ -1,16 +1,21 @@
 #!/usr/bin/make -f
 
+#: see http://lists.debian.org/debian-devel-announce/2011/09/msg00001.html
+#: Also it does hardening by default, see http://wiki.debian.org/Hardening
+DPKG_EXPORT_BUILDFLAGS = 1
+-include /usr/share/dpkg/default.mk
+
 %:
 	dh ${@} --with autotools_dev
 
 override_dh_auto_configure:
-	LDCONFIG="/sbin/ldconfig -n" dh_auto_configure
+	LDCONFIG="/sbin/ldconfig -n" dh_auto_configure -- --enable-libmount=yes
 
 override_dh_auto_install:
 	dh_auto_install -- DESTDIR=$(CURDIR)/debian/nilfs-tools
 
 	# removing unused files
-	rm -f debian/nilfs-tools/usr/lib/*.la
+	$(RM) debian/nilfs-tools/usr/lib/*.la
 
 override_dh_builddeb:
 	dh_builddeb -- -Zgzip -z9
diff -Nru nilfs-tools-2.1.0/debian/watch nilfs-tools-2.1.1/debian/watch
--- nilfs-tools-2.1.0/debian/watch	1970-01-01 10:00:00.000000000 +1000
+++ nilfs-tools-2.1.1/debian/watch	2012-01-21 18:34:11.000000000 +1100
@@ -0,0 +1,8 @@
+# Run the "uscan" command
+# to check for upstream updates and more.
+# See uscan(1) for format
+
+# Compulsory line, this is a version 3 file
+version=3
+
+http://www.nilfs.org/download/nilfs-utils-(\d+\.\d+\.\d+)\.tar\.bz2
diff -Nru nilfs-tools-2.1.0/include/cno.h nilfs-tools-2.1.1/include/cno.h
--- nilfs-tools-2.1.0/include/cno.h	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/include/cno.h	2012-01-14 20:43:06.000000000 +1100
@@ -10,6 +10,7 @@
 #ifndef NILFS_CNO_H
 #define NILFS_CNO_H
 
+extern nilfs_cno_t nilfs_parse_cno(const char *arg, char **endptr, int base);
 extern int nilfs_parse_cno_range(const char *arg, __u64 *start, __u64 *end,
 				 int base);
 
diff -Nru nilfs-tools-2.1.0/include/kern_compat.h nilfs-tools-2.1.1/include/kern_compat.h
--- nilfs-tools-2.1.0/include/kern_compat.h	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/include/kern_compat.h	1970-01-01 10:00:00.000000000 +1000
@@ -1,47 +0,0 @@
-/*
- * kern_compat.h - kernel compat declarations
- *
- * Copyright (C) 2005-2011 Nippon Telegraph and Telephone Corporation.
- *
- * This program can be redistributed under the terms of the GNU Lesser
- * General Public License.
- */
-
-#ifndef NILFS_KERN_COMPAT_H
-#define NILFS_KERN_COMPAT_H
-
-#include <linux/types.h>
-#include <endian.h>
-#include <byteswap.h>
-
-#ifndef __bitwise  /* Tricky workaround; should be replaced */
-typedef __u64 __le64;
-typedef __u32 __le32;
-typedef __u16 __le16;
-#endif
-
-#ifndef le32_to_cpu
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define cpu_to_le16(x) (x)
-#define cpu_to_le32(x) (x)
-#define cpu_to_le64(x) (x)
-#define le16_to_cpu(x) (x)
-#define le32_to_cpu(x) (x)
-#define le64_to_cpu(x) (x)
-#elif __BYTE_ORDER == __BIG_ENDIAN
-#define le16_to_cpu(x) bswap_16(x)
-#define le32_to_cpu(x) bswap_32(x)
-#define le64_to_cpu(x) bswap_64(x)
-#define cpu_to_le16(x) bswap_16(x)
-#define cpu_to_le32(x) bswap_32(x)
-#define cpu_to_le64(x) bswap_64(x)
-#else
-#error "unsupported endian"
-#endif /* __BYTE_ORDER */
-#endif /* le32_to_cpu */
-
-#ifndef BUG
-#define BUG()	abort()
-#endif
-
-#endif	/* NILFS_KERN_COMPAT_H */
diff -Nru nilfs-tools-2.1.0/include/Makefile.am nilfs-tools-2.1.1/include/Makefile.am
--- nilfs-tools-2.1.0/include/Makefile.am	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/include/Makefile.am	2012-01-14 20:43:06.000000000 +1100
@@ -1,5 +1,5 @@
 ## Makefile.am
 
 include_HEADERS = nilfs.h nilfs2_fs.h nilfs_cleaner.h
-noinst_HEADERS = realpath.h nls.h cno.h kern_compat.h nilfs_feature.h \
+noinst_HEADERS = realpath.h nls.h cno.h nilfs_feature.h \
 	vector.h nilfs_gc.h cnoconv.h cleaner_msg.h cleaner_exec.h
diff -Nru nilfs-tools-2.1.0/include/Makefile.in nilfs-tools-2.1.1/include/Makefile.in
--- nilfs-tools-2.1.0/include/Makefile.in	2011-11-24 02:35:21.000000000 +1100
+++ nilfs-tools-2.1.1/include/Makefile.in	2012-01-14 21:36:17.000000000 +1100
@@ -170,7 +170,7 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 include_HEADERS = nilfs.h nilfs2_fs.h nilfs_cleaner.h
-noinst_HEADERS = realpath.h nls.h cno.h kern_compat.h nilfs_feature.h \
+noinst_HEADERS = realpath.h nls.h cno.h nilfs_feature.h \
 	vector.h nilfs_gc.h cnoconv.h cleaner_msg.h cleaner_exec.h
 
 all: all-am
diff -Nru nilfs-tools-2.1.0/lib/cno.c nilfs-tools-2.1.1/lib/cno.c
--- nilfs-tools-2.1.0/lib/cno.c	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/lib/cno.c	2012-01-14 20:43:06.000000000 +1100
@@ -35,8 +35,21 @@
 #endif	/* HAVE_STRING_H */
 
 #include <assert.h>
+#include <ctype.h>
 #include "nilfs.h"
 
+nilfs_cno_t nilfs_parse_cno(const char *arg, char **endptr, int base)
+{
+	/* ensure the number we are about to parse is not negative, which
+	 * strtoull() will happily accept and cast to an unsigned value. */
+	while (isspace(*arg))
+		arg++;
+	if (*arg == '-')
+		return NILFS_CNO_MAX;
+
+	return strtoull(arg, endptr, base);
+}
+
 int nilfs_parse_cno_range(const char *arg, __u64 *start, __u64 *end, int base)
 {
 	const char *delim;
@@ -49,8 +62,8 @@
 	if (delim && delim == arg) {
 		if (arg[2] != '\0') {
 			/* ..yyy */
-			cno = strtoull(arg + 2, &endptr, base);
-			if (*endptr == '\0') {
+			cno = nilfs_parse_cno(arg + 2, &endptr, base);
+			if (cno < NILFS_CNO_MAX && *endptr == '\0') {
 				/* ..CNO */
 				*start = NILFS_CNO_MIN;
 				*end = cno;
@@ -59,24 +72,24 @@
 		}
 	} else if (!delim) {
 		/* xxx */
-		cno = strtoull(arg, &endptr, base);
-		if (*endptr == '\0') {
+		cno = nilfs_parse_cno(arg, &endptr, base);
+		if (cno < NILFS_CNO_MAX && *endptr == '\0') {
 			/* CNO */
 			*start = *end = cno;
 			return 0;
 		}
 	} else {
 		/* xxx..yyy */
-		cno = strtoull(arg, &endptr, base);
-		if (endptr == delim) {
+		cno = nilfs_parse_cno(arg, &endptr, base);
+		if (cno < NILFS_CNO_MAX && endptr == delim) {
 			if (delim[2] == '\0') {
 				/* CNO.. */
 				*start = cno;
 				*end = NILFS_CNO_MAX;
 				return 0;
 			}
-			cno2 = strtoull(delim + 2, &endptr, base);
-			if (*endptr == '\0') {
+			cno2 = nilfs_parse_cno(delim + 2, &endptr, base);
+			if (cno2 < NILFS_CNO_MAX && *endptr == '\0') {
 				/* CNO..CNO */
 				*start = cno;
 				*end = cno2;
diff -Nru nilfs-tools-2.1.0/lib/feature.c nilfs-tools-2.1.1/lib/feature.c
--- nilfs-tools-2.1.0/lib/feature.c	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/lib/feature.c	2012-01-14 20:43:06.000000000 +1100
@@ -43,7 +43,7 @@
 
 #include <errno.h>
 #include <assert.h>
-#include "kern_compat.h"
+#include "nilfs.h"
 #include "nilfs2_fs.h"
 #include "nilfs_feature.h"
 
diff -Nru nilfs-tools-2.1.0/man/mkfs.nilfs2.8 nilfs-tools-2.1.1/man/mkfs.nilfs2.8
--- nilfs-tools-2.1.0/man/mkfs.nilfs2.8	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/man/mkfs.nilfs2.8	2012-01-14 20:43:06.000000000 +1100
@@ -36,6 +36,9 @@
 .IR feature [,...]
 ]
 [
+.B \-h
+]
+[
 .B \-q
 ]
 [
@@ -77,6 +80,9 @@
 .IR feature [,...]
 ]
 [
+.B \-h
+]
+[
 .B \-q
 ]
 [
@@ -114,6 +120,9 @@
 .B \-c
 Check the device for bad blocks before building the filesystem.
 .TP
+.B \-h
+Display help message and exit.
+.TP
 .BI \-K
 Keep, do not attempt to discard blocks at mkfs time (discarding blocks
 initially is useful on solid state drives and sparse /
diff -Nru nilfs-tools-2.1.0/sbin/mkfs/mkfs.c nilfs-tools-2.1.1/sbin/mkfs/mkfs.c
--- nilfs-tools-2.1.0/sbin/mkfs/mkfs.c	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/sbin/mkfs/mkfs.c	2012-01-14 20:43:06.000000000 +1100
@@ -72,8 +72,9 @@
 
 #include <errno.h>
 
-#include "mkfs.h"
+#include "nilfs.h"
 #include "nilfs_feature.h"
+#include "mkfs.h"
 
 
 typedef __u64  blocknr_t;
@@ -646,7 +647,7 @@
 	write_disk(fd, di); /* Writing to the device */
 
 	close(fd);
-	exit(0);
+	exit(EXIT_SUCCESS);
 }
 
 /*
@@ -691,7 +692,7 @@
 		args[i++] = device;
 		args[i] = NULL;
 		execv(badblocks, (char **)args);
-		exit(1); /* reach only if failed */
+		exit(EXIT_FAILURE); /* reach only if failed */
 	} else if (pid != -1) {
 		if (wait(&status) < 0)
 			perr("Error: cannot wait child");
@@ -972,7 +973,7 @@
 	int c, show_version_only = 0;
 	char *fs_features = NULL;
 
-	while ((c = getopt(argc, argv, "b:B:cKL:m:nqvO:P:V")) != EOF) {
+	while ((c = getopt(argc, argv, "b:B:chKL:m:nqvO:P:V")) != EOF) {
 		switch (c) {
 		case 'b':
 			blocksize = atol(optarg);
@@ -984,6 +985,9 @@
 		case 'c':
 			cflag++;
 			break;
+		case 'h':
+			usage();
+			exit(EXIT_SUCCESS);
 		case 'K':
 			discard = 0;
 			break;
@@ -1014,6 +1018,7 @@
 			break;
 		default:
 			usage();
+			exit(EXIT_FAILURE);
 		}
 	}
 
@@ -1021,11 +1026,15 @@
 		verbose = 0;
 
 	if ((optind == argc) && !show_version_only)
+	{
+		printf("%d %d\n", optind, argc);
 		usage();
+		exit(EXIT_FAILURE);
+	}
 
 	if (show_version_only) {
 		show_version();
-		exit(0);
+		exit(EXIT_SUCCESS);
 	}
 
 	check_blocks_per_segment(blocks_per_segment);
@@ -1048,11 +1057,10 @@
 {
 	fprintf(stderr,
 		"Usage: %s [-b block-size] [-B blocks-per-segment] [-c] \n"
-		"[-L volume-label] [-m reserved-segments-percentage] \n"
-		"[-O feature[,...]] \n"
-		"[-nqvKV] device\n",
+		"       [-L volume-label] [-m reserved-segments-percentage] \n"
+		"       [-O feature[,...]] \n"
+		"       [-hnqvKV] device\n",
 		progname);
-	exit(1);
 }
 
 static void show_version(void)
@@ -1079,7 +1087,7 @@
 	vfprintf(stderr, fmt, args);
 	fprintf(stderr, "\n");
 	va_end(args);
-	exit(1);
+	exit(EXIT_FAILURE);
 }
 
 static void cannot_rw_device(int fd, const char *device, int rw)
diff -Nru nilfs-tools-2.1.0/sbin/mkfs/mkfs.h nilfs-tools-2.1.1/sbin/mkfs/mkfs.h
--- nilfs-tools-2.1.0/sbin/mkfs/mkfs.h	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/sbin/mkfs/mkfs.h	2012-01-14 20:43:06.000000000 +1100
@@ -24,7 +24,6 @@
  * Revised by Ryusuke Konishi <ryus...@osrg.net>.
  */
 
-#include "kern_compat.h"
 #include "nilfs2_fs.h"
 
 #define NILFS_DISKHDR_SIZE 		4096 /* HDD header (MBR+superblock) */
@@ -41,9 +40,6 @@
 #define NILFS_DEF_RESERVED_SEGMENTS     5    /* default percentage of reserved
 						segments: 5% */
 
-#define NILFS_CNO_MIN   1
-#define NILFS_CNO_MAX   (~(__u64)0)
-
 #define NILFS_MAX_BMAP_ROOT_PTRS	(NILFS_INODE_BMAP_SIZE - 1)
 #define NILFS_MIN_BLOCKSIZE		1024
 #define NILFS_MIN_NUSERSEGS		8    /* Minimum number of user
diff -Nru nilfs-tools-2.1.0/sbin/mount/umount_libmount.c nilfs-tools-2.1.1/sbin/mount/umount_libmount.c
--- nilfs-tools-2.1.0/sbin/mount/umount_libmount.c	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/sbin/mount/umount_libmount.c	2012-01-14 20:43:06.000000000 +1100
@@ -183,8 +183,6 @@
 		error(_("%s: %s: I/O error while unmounting"), progname, dev);
 		break;
 	case EBUSY:
-		/* Let us hope fstab has a line "proc /proc ..."
-		   and not "none /proc ..."*/
 		error(_("%s: %s: device is busy"), progname, dev);
 		break;
 	case ENOENT:
@@ -284,7 +282,7 @@
 	if (!mnt_context_is_fake(umi->cxt)) {
 		res = nilfs_do_umount_one(umi);
 		if (res) {
-			complain(-res, mnt_context_get_source(umi->cxt));
+			complain(res, mnt_context_get_source(umi->cxt));
 			goto failed;
 		}
 	}
diff -Nru nilfs-tools-2.1.0/sbin/nilfs-clean/nilfs-clean.c nilfs-tools-2.1.1/sbin/nilfs-clean/nilfs-clean.c
--- nilfs-tools-2.1.0/sbin/nilfs-clean/nilfs-clean.c	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/sbin/nilfs-clean/nilfs-clean.c	2012-01-14 20:43:06.000000000 +1100
@@ -331,7 +331,7 @@
 	char *endptr;
 	int ret = 0;
 
-	period = strtoul(arg, &endptr, 10);
+	period = strtoull(arg, &endptr, 10);
 	if (endptr == arg) {
 		myprintf(_("Error: invalid protection period: %s\n"), arg);
 		ret = -1;
diff -Nru nilfs-tools-2.1.0/sbin/nilfs-tune/nilfs-tune.c nilfs-tools-2.1.1/sbin/nilfs-tune/nilfs-tune.c
--- nilfs-tools-2.1.0/sbin/nilfs-tune/nilfs-tune.c	2011-11-24 01:44:07.000000000 +1100
+++ nilfs-tools-2.1.1/sbin/nilfs-tune/nilfs-tune.c	2012-01-14 20:43:06.000000000 +1100
@@ -100,7 +100,7 @@
 	0
 };
 
-int parse_uuid(const char *uuid_string, __u8 *uuid)
+static int parse_uuid(const char *uuid_string, __u8 *uuid)
 {
 	int i;
 	char p[3];
@@ -126,7 +126,8 @@
 	return 0;
 }
 
-void parse_options(int argc, char *argv[], struct nilfs_tune_options *opts)
+static void parse_options(int argc, char *argv[],
+		struct nilfs_tune_options *opts)
 {
 	int c;
 	opts->flags = O_RDONLY;
@@ -186,6 +187,12 @@
 			exit(EXIT_FAILURE);
 		}
 	}
+
+	if (optind == argc)
+	{
+		nilfs_tune_usage();
+		exit(EXIT_FAILURE);
+	}
 }
 
 #define MINUTE	(60)
@@ -274,7 +281,7 @@
 	return buf;
 }
 
-static const char *uuid_string(unsigned char *uuid)
+static const char *uuid_string(const unsigned char *uuid)
 {
 	static char buf[256];
 
@@ -349,7 +356,7 @@
 	fputs("\n", f);
 }
 
-void show_nilfs_sb(struct nilfs_super_block *sbp)
+static void show_nilfs_sb(struct nilfs_super_block *sbp)
 {
 	char label[sizeof(sbp->s_volume_name) + 1];
 	gid_t gid;
@@ -491,7 +498,7 @@
 	return ret;
 }
 
-int modify_nilfs(char *device, struct nilfs_tune_options *opts)
+static int modify_nilfs(const char *device, struct nilfs_tune_options *opts)
 {
 	int devfd;
 	int ret = EXIT_SUCCESS;
@@ -563,7 +570,7 @@
 int main(int argc, char *argv[])
 {
 	struct nilfs_tune_options opts;
-	char *device;
+	const char *device;
 
 	printf("nilfs-tune %s\n", VERSION);
 	if (argc < 2) {

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to