The bitops functions were declared as 'extern inline' in include/misc.h but
weren't actually defined there. They were also defined as inline in
lib/misc.c, which can't actually happen if they're used elsewhere.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
The upstream kernel got rid of the per-endian implementations of
the offset_v2 helpers in favor of explicitly accessing by little
endian bitranges.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
reiserfs_invalidate_buffer contains an argument to specify whether a block
should be freed after being invalidated. It is always passed as 1, so
let's just get rid of it.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
We open code buffer_info initialization all over the place. Let's
factor that out so we don't reproduce the code everywhere.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This patch does a quick search and replace:
B_N_PITEM_HEAD() -> item_head()
B_N_PDELIM_KEY() -> internal_key()
B_N_PKEY() -> leaf_key()
B_N_PITEM() -> item_body()
And the item_head version:
B_I_PITEM() -> ih_item_body()
I_ENTRY_COUNT() -> ih_entry_count()
And the treepath variants:
get_ih() -> tp_item_head()
PATH_PITEM_HEAD() -> tp_item_head()
get_item() -> tp_item_body()
... which makes the code much easier on the eyes.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Over the years, the reiserfs kernel code has been gradually cleaned up
to be more readable. This patch does the same to the progs code.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
In order to convert reiserfscore into a externally-usable library,
we need to rename structures so they won't collide with other
namespaces.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
We have met a situation when reiserfsck segfaulted on one of our
partitions. I have performed a small research and the cause appeared
to be wrong detection of transaction count.
Our FS had only one journal transaction, however trans_count which was
passed to progbar_update() as maximum transaction value was detected
as (last_transaction - first_transaction) which in our case was 0.
Thus progbar_update() resulted in segmentation fault:
(gdb) bt
"Replaying journal", curr=1, max=0, dpynum=1) at progbar.c:80
Here is part of debugreiserfs -j output
Journal header (block #8210 of ./partition.bug):
j_last_flush_trans_id 0
j_first_unflushed_offset 0
j_mount_id 10
Device [0x0]
Magic [0x4f0a099e]
Size 8193 blocks (including 1 for journal header) (first block 18)
Max transaction length 1024 blocks
Max batch size 900 blocks
Max commit age 30
Mountid 10, transid 10, desc 18, length 2, commit 21
I successfully reproduced it on versions 3.6.21 (which we were using)
and 3.6.23 (which I believe is the latest).
Attaching patch. Let me know your opinion. If I am wrong, please
comment, if I am correct, feel free to include patch into sources.
Thanks.
Signed-off-by: Victor Leschuk <vleschuk@gmail.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
While Namesys drove almost all reiserfs development and was instrumental
in supporting it for many years, it has been offline for the past
6 years. All of its founders and employees have moved on to other
endeavors or are otherwise unavailable. This can be confusing to users
since the documentation points there either for background information
or to have bugs fixed.
This patch removes most of the non-historical references to
namesys.com and directs users to the reiserfs-devel list on vger.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
When performing an offline resize of a file system that will grow
beyond 8 TB, we see negative block counts:
ReiserFS report:
blocksize 4096
block count -1610612480 (1879048192)
free blocks -1610702612 (1878982637)
bitmap block count 0 (57344)
The values are passed around appropriately but are printed
incorrectly.
Reported-by: Jimb Esser <wasteland@gmail.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
We create links like fsck.reiserfs to reiserfsck but don't provide
the corresponding links to the man pages.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This allows you to build out of tree like:
mkdir build
../configure
make
This also fixes `make distcheck` since that uses the above mechanism.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Use standard autoconf macros rather than open coding the logic.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
ENABLE_DEBUG isn't used anywhere, so punt it.
--enable-debug is only used to control whether to enable -W flags by
default. But there's no harm just always doing that, so drop the
configure flag and enable the -W flags when they're available.
AC_CACHE_CHECK requires cache vars have "_cv_" in their name, so tweak
all the cache var names to include that.
That leaves us with the PRESET_CFLAGS logic which is pointless nowadays
as autoconf largely does the same thing for us. It'll default to using
'-O2 -g -Wall' if the compiler supports it, so no need to do it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
We don't create any libraries so there's no need to build with -fPIC.
Drop it all.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This converts away from the old/deprecated AM_INIT_AUTOMAKE method.
Also enable the nice silent build by default.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Newer autotools complains if you use the old style name.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
The CREDITS file contains the credits for the reiserfsprogs. Users
have been complaining for years that they don't need to see them
at every invokation.
This patch removes it.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
register_printf_modifier is causing build warnings complaining that
it is deprecated. This patch adds support for register_printf_specifier
and uses it if it's present. Otherwise, it will fall back to
register_printf_modifier.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Every other fsck util out there supports non-interactive forcing and this
change brings reiserfsck into line.
Signed-off-by: Roy Marples <roy@marples.name>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This patch fixes the following warning:
prints.c:403:20: warning: ‘num’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This patch fixes the following warnings:
pointer targets in passing argument 5 of ‘reiserfs_bin_search’ differ in signedness [-Wpointer-sign]
pointer targets in passing argument 2 of ‘init_rollback_file’ differ in signedness [-Wpointer-sign]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This patch fixes the following warning:
unpack.c:536:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This patch fixes a bunch of the following warnings:
warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
warning: pointer targets in passing argument 1 of ‘__builtin_strncpy’ differ in signedness [-Wpointer-sign]
warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness [-Wpointer-sign]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This patch fixes:
main.c:968:11: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘time_t’ [-Wformat]
prints.c:152:7: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u32’ [-Wformat]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
These files change every time configure.in or Makefile.am is changed,
we can autogenerate them when exporting a tarball.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Now that we handle file systems > 8 TB, we end up printing large negative
numbers instead of actual block numbers. This patch fixes those places
to use unsigned ints for block numbers.
Signed-by: Jeff Mahoney <jeffm@suse.com>
fsck_progress uses fs to get the log file handle but fs is freed before
fsck_progress is caleld when it's about to print the "finished" message.
When glibc is run with:
MALLOC_CHECK_=3
MALLOC_PERTURB_=69
as is the default on newer versions of openSUSE, it poisons freed memory
to detect conditions like this. As a result, reiserfsck segfaults on these
systems.
This patch fixes fsck to close the file system after printing the completion
message.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Since utilities expect to be able to run `mkfs.$FS` and `fsck.$FS`,
reiserfs should install symlinks for these to the right place.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>