The AC_HEADER_STDC macro is diagnosed as obsolete in Autoconf 2.70 and
later:
configure.ac:88: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:88: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:88: the top level
Fix the warning just by removing the macro. This looks to be fine so
far, but if we have problems with some legacy systems, we may need to
add individual remedies.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
The latter is diagnosed as obsolete in Autoconf 2.70. Use the former
to enables _GNU_SOURCE instead. The AC_USE_SYSTEM_EXTENSIONS macro
was introduced in Autoconf 2.60 and allows to enable features of Posix
as well as platform extensions not defined by Posix.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Documentation for coding styles and patch submission rules no longer
exists at the URLs in the README file.
As alternatives, refer to the HTML documents on docs.kernel.org.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
The git protocol on port 9418 is no longer supported on GitHub for
security purposes.
This patch updates the git clone command execution example in the
README file according to the change.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Even if we give "required size" that mkfs.nilfs2 suggests for too
small devices, mkfs.nilfs2 fails due to the lack of consideration of
the trailing super block:
Error: too small device.
device size=134217728 bytes, required size=134217728 bytes.
Please enlarge the device, or shorten segments with -B option.
This fixes the issue.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
When device size is too small, mkfs.nilfs2 aborts with a message
suggesting a required device size. However, this calculation
underflows and causes to report a huge value if the device size is
insufficient to keep a segment.
This fixes the issue and closes#14.
Reported-by: Евгений Кустов <megajohn@inbox.ru>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
cpu_to_le32/le32_to_cpu is defined in include/linux/byteorder/generic.h,
which is not exported to user-space.
UAPI headers must use the ones prefixed with double-underscore.
Detected by compile-testing exported headers:
include/linux/nilfs2_ondisk.h: In function `nilfs_checkpoint_set_snapshot':
include/linux/nilfs2_ondisk.h:536:17: error: implicit declaration of function `cpu_to_le32' [-Werror=implicit-function-declaration]
cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \
^
include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
^~~~~~~~~~~~~~~~~~~~
include/linux/nilfs2_ondisk.h:536:29: error: implicit declaration of function `le32_to_cpu' [-Werror=implicit-function-declaration]
cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \
^
include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
^~~~~~~~~~~~~~~~~~~~
include/linux/nilfs2_ondisk.h: In function `nilfs_segment_usage_set_clean':
include/linux/nilfs2_ondisk.h:622:19: error: implicit declaration of function `cpu_to_le64' [-Werror=implicit-function-declaration]
su->su_lastmod = cpu_to_le64(0);
^~~~~~~~~~~
Link: http://lkml.kernel.org/r/20190605053006.14332-1-yamada.masahiro@socionext.com
Fixes: e63e88bc53ba ("nilfs2: move ioctl interface and disk layout to uapi separately")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: <stable@vger.kernel.org> [4.9+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Update email addresses of NTT developers since lab.ntt.co.jp email
domain has been deprecated due to company policy.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Link option of uuid library ('-luuid') still appears in front of blkid
library ('-lblkid') even though the latter depends on the former. Fix
the library order by swapping them.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
make sure that libuuid is linked during probes.
Since libmount depends on libblkid, probe libblkid first.
This fixes autoprobing on systems that use static libraries exclusively
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
rpc/types.h does not exist on low-footprint musl toolchains,
and is only required for the boolean types, which musl provides
elsewhere.
This commit drops the include completely.
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
musl does provide _POSIX_MAX_INPUT, but no MAX_INPUT out of the box.
This commit assigns _POSIX_MAX_INPUT to MAX_INPUT.
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
The domain of NILFS project home was changed to nilfs.sourceforge.io
to enable https access. This replaces ths URL strings
"http://nilfs.sourceforge.net" in man pages with
"https://nilfs.sourceforge.io".
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Under certain high concurrency loads, NILFS2 can produce a segment that
crashes the cleanerd process with a conflicting data buffer error. The
segment is perfectly valid and the file system is not corrupted.
However, the cleanerd process can no longer be started and the file
system will eventually fill up and cannot be used any more.
The reason for this crash is, that a single logical segment can contain
multiple partial segments. If a block is written in one partial segment
and then immediately overwritten in another partial segment, then these
blocks have the same inode number, checkpoint number and offset.
However, these three numbers are used by the kernel to uniquely
identify a block. If the cleaner tries to clean two blocks that point
to the exact same buffer_head in the kernel, it creates a conflicting
data buffer error.
The solution is to detect these blocks and treat them as dead blocks.
If vd_period.p_end is equal to the checkpoint number, it means that the
block was overwritten within the same logical segment. So it must be
dead, and there is another block with the same ino, cno, and offset,
which is alive.
Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Obsolete sub directories "sbin/nilfs-clean/", "sbin/nilfs-resize/",
and "sbin/nilfs-tune/" are not deletable by "git clean -df". This
fixes the issue.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
The ".nilfs" file is no longer used from utils nor the kernel module.
Remove .nilfs file from the initial directory entries.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Remove "libnilfscleaner.so" dynamic link library and instead build
private library "libcleaner.la" for clients of cleanerd such as
nilfs-clean command.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Replace __u64, __u32, __u8, __s64, and __s32 with standard uint64_t,
uint32_t, uint8_t, int64_t and int32_t types, respectively, except for
nilfs2_api.h and nilfs2_ondisk.h.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Some functions are followed by a curly brace '{' in the same line:
int
mtab_does_not_exist(void) {
....
}
This transforms them with the following standard style:
int mtab_does_not_exist(void)
{
....
}
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sort out dependent header files: include "sys/types.h", and remove
references to "stdio.h", "stdlib.h", "unistd.h", "fcntl.h", "time.h",
and "sys/ioctl.h".
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
The implementation of nilfs-tune command needs to include "fcntl.h"
and "unistd.h" header files since nilfs-tune directly uses functions
and definitions declared there.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Usually, "stddef.h" header file has the definition of offsetof()
macro. Use it and refer to the alternative offsetof() definition in
compat.h only if the original macro is not available in "stddef.h".
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Refer to time.h since the timespec struct declared in "time.h" is used
in some api functions.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Remove the reference to "nilfs.h" from "nilfs_cleaner.h" header file
since it doesn't depend on the NILFS api.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Re-define operations on nilfs options as inline functions using new
generic functions nilfs_opt_{test,set,clear}() in order to make them
more flexible for future extension.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Add generic lock operations for nilfs to hide nilfs->n_sems[] array
from libnilfs interface, and use them to acquire, trylock, or release
the lock.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Accesses to finfo in nilfs_file_next() and nilfs_file_init() can
overrun since the termination condition of the file iterator is tested
after these functions return and the position of finfo is checked
afterwards as well.
This fixes the issue by inserting pre-checks for the position of finfo
before reading it.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Add a member which keeps the size of segment summary information to
nilfs_file struct for convenience.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
On-disk summary information of files can fall into inconsistent
states in theory:
- The block count recorded in finfo can exceed the number of
remaining payload blocks.
- The number of data blocks recorded in finfo can be larger than the
number of total blocks of the file, or
- The total size of finfo and binfo structures can exceed the size of
summary information of the partial segment.
This adds sanity checks for these glitches to nilfs_file, and adds a
framework to handle these errors as well.
Also, this enhances the error output routine of dumpseg command to
handle these errors nicely.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Add a function to calculate the number of summary blocks and use it in
nilfs_file_init().
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Add a function to calculate the size of finfo and binfo structures
that a given file occupies within segment summary information, where
we make the helper separating the logic from nilfs_file_next().
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
The macros NILFS_BINFO_XXX_SIZE are used only by functions
in segment.c. Move them into the library implementation.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Define NILFS_BINFO_DATA_SIZE and NILFS_BINFO_DAT_NODE_SIZE with
nilfs_binfo_v and nilfs_binfo_dat structs, respectively. These macros
gives the size of binfo data block in usual files and node blocks in
the DAT file.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Increment API version for libnilfs and libnilfsgc to reflect the
removal/addition/change of exported functions.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>