11 Jan, 2012
1 commit
-
In the mount path, transactions that are made before journal
initialization don't involve the filesystem. We can delay the reiserfs
lock until we play with the journal.Signed-off-by: Frederic Weisbecker
Cc: Al Viro
Cc: Christoph Hellwig
Cc: Jeff Mahoney
Cc: Jan Kara
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Jan, 2012
1 commit
-
Make reiserfs properly display mount options in /proc/mounts.
CC: reiserfs-devel@vger.kernel.org
Signed-off-by: Jan Kara
Signed-off-by: Al Viro
26 Jul, 2011
2 commits
-
Use hweight_long() to count free bits in the bitmap.
Signed-off-by: Akinobu Mita
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Using __test_and_{set,clear}_bit_le() with ignoring its return value can
be replaced with __{set,clear}_bit_le().This introduces reiserfs_{set,clear}_le_bit for __{set,clear}_bit_le and
does the above change with them.Signed-off-by: Akinobu Mita
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Mar, 2010
1 commit
-
Conflicts:
Documentation/filesystems/proc.txt
arch/arm/mach-u300/include/mach/debug-macro.S
drivers/net/qlge/qlge_ethtool.c
drivers/net/qlge/qlge_main.c
drivers/net/typhoon.c
05 Mar, 2010
1 commit
-
Get rid of the alloc_space, free_space, reserve_space, claim_space and
release_rsv dquot operations - they are always called from the filesystem
and if a filesystem really needs their own (which none currently does)
it can just call into it's own routine directly.Move shared logic into the common __dquot_alloc_space,
dquot_claim_space_nodirty and __dquot_free_space low-level methods,
and rationalize the wrappers around it to move as much as possible
code into the common block for CONFIG_QUOTA vs not. Also rename
all these helpers to be named dquot_* instead of vfs_dq_*.Signed-off-by: Christoph Hellwig
Signed-off-by: Jan Kara
09 Feb, 2010
1 commit
-
In particular, several occurances of funny versions of 'success',
'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address',
'beginning', 'desirable', 'separate' and 'necessary' are fixed.Signed-off-by: Daniel Mack
Cc: Joe Perches
Cc: Junio C Hamano
Signed-off-by: Jiri Kosina
14 Dec, 2009
1 commit
-
While allocating the bitmap using vmalloc, we hold the reiserfs lock,
which makes lockdep later reporting a possible deadlock as we may
swap out pages to allocate memory and then take the reiserfs lock
recursively:inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
kswapd0/312 [HC0[0]:SC0[0]:HE1:SE1] takes:
(&REISERFS_SB(s)->lock){+.+.?.}, at: [] reiserfs_write_lock+0x28/0x40
{RECLAIM_FS-ON-W} state was registered at:
[] mark_held_locks+0x62/0x90
[] lockdep_trace_alloc+0x9a/0xc0
[] kmem_cache_alloc+0x26/0xf0
[] __get_vm_area_node+0x6c/0xf0
[] __vmalloc_node+0x7e/0xa0
[] vmalloc+0x2b/0x30
[] reiserfs_init_bitmap_cache+0x39/0x70
[] reiserfs_fill_super+0x2e8/0xb90
[] get_sb_bdev+0x145/0x180
[] get_super_block+0x21/0x30
[] vfs_kern_mount+0x40/0xd0
[] do_kern_mount+0x39/0xd0
[] do_mount+0x2c7/0x6b0
[] sys_mount+0x66/0xa0
[] mount_block_root+0xc4/0x245
[] mount_root+0x59/0x5f
[] prepare_namespace+0x111/0x14b
[] kernel_init+0xcf/0xdb
[] kernel_thread_helper+0x7/0x1cThis is actually fine for two reasons: we call vmalloc at mount time
then it's not in the swapping out path. Also the reiserfs lock can be
acquired recursively, but since its implementation depends on a mutex,
it's hard and not necessary worth it to teach that to lockdep.The lock is useless at mount time anyway, at least until we replay the
journal. But let's remove it from this path later as this needs
more thinking and is a sensible change.For now we can just relax the lock around vmalloc,
Reported-by: Alexander Beregalov
Signed-off-by: Frederic Weisbecker
Cc: Chris Mason
Cc: Ingo Molnar
Cc: Thomas Gleixner
14 Sep, 2009
2 commits
-
reiserfs_read_bitmap_block() uses sb_bread() to read the bitmap block. This
helper might sleep.Then, when the bkl was used, it was released at this point. We can then
relax the write lock too here.[ Impact: release the reiserfs write lock when it is not needed ]
Cc: Jeff Mahoney
Cc: Chris Mason
Cc: Alexander Beregalov
Signed-off-by: Frederic Weisbecker -
This patch is an attempt to remove the Bkl based locking scheme from
reiserfs and is intended.It is a bit inspired from an old attempt by Peter Zijlstra:
http://lkml.indiana.edu/hypermail/linux/kernel/0704.2/2174.html
The bkl is heavily used in this filesystem to prevent from
concurrent write accesses on the filesystem.Reiserfs makes a deep use of the specific properties of the Bkl:
- It can be acqquired recursively by a same task
- It is released on the schedule() calls and reacquired when schedule() returnsThe two properties above are a roadmap for the reiserfs write locking so it's
very hard to simply replace it with a common mutex.- We need a recursive-able locking unless we want to restructure several blocks
of the code.
- We need to identify the sites where the bkl was implictly relaxed
(schedule, wait, sync, etc...) so that we can in turn release and
reacquire our new lock explicitly.
Such implicit releases of the lock are often required to let other
resources producer/consumer do their job or we can suffer unexpected
starvations or deadlocks.So the new lock that replaces the bkl here is a per superblock mutex with a
specific property: it can be acquired recursively by a same task, like the
bkl.For such purpose, we integrate a lock owner and a lock depth field on the
superblock information structure.The first axis on this patch is to turn reiserfs_write_(un)lock() function
into a wrapper to manage this mutex. Also some explicit calls to
lock_kernel() have been converted to reiserfs_write_lock() helpers.The second axis is to find the important blocking sites (schedule...(),
wait_on_buffer(), sync_dirty_buffer(), etc...) and then apply an explicit
release of the write lock on these locations before blocking. Then we can
safely wait for those who can give us resources or those who need some.
Typically this is a fight between the current writer, the reiserfs workqueue
(aka the async commiter) and the pdflush threads.The third axis is a consequence of the second. The write lock is usually
on top of a lock dependency chain which can include the journal lock, the
flush lock or the commit lock. So it's dangerous to release and trying to
reacquire the write lock while we still hold other locks.This is fine with the bkl:
T1 T2
lock_kernel()
mutex_lock(A)
unlock_kernel()
// do something
lock_kernel()
mutex_lock(A) -> already locked by T1
schedule() (and then unlock_kernel())
lock_kernel()
mutex_unlock(A)
....This is not fine with a mutex:
T1 T2
mutex_lock(write)
mutex_lock(A)
mutex_unlock(write)
// do something
mutex_lock(write)
mutex_lock(A) -> already locked by T1
schedule()mutex_lock(write) -> already locked by T2
deadlockThe solution in this patch is to provide a helper which releases the write
lock and sleep a bit if we can't lock a mutex that depend on it. It's another
simulation of the bkl behaviour.The last axis is to locate the fs callbacks that are called with the bkl held,
according to Documentation/filesystem/Locking.Those are:
- reiserfs_remount
- reiserfs_fill_super
- reiserfs_put_superReiserfs didn't need to explicitly lock because of the context of these callbacks.
But now we must take care of that with the new locking.After this patch, reiserfs suffers from a slight performance regression (for now).
On UP, a high volume write with dd reports an average of 27 MB/s instead
of 30 MB/s without the patch applied.Signed-off-by: Frederic Weisbecker
Reviewed-by: Ingo Molnar
Cc: Jeff Mahoney
Cc: Peter Zijlstra
Cc: Bron Gondwana
Cc: Andrew Morton
Cc: Linus Torvalds
Cc: Alexander Viro
LKML-Reference:
Signed-off-by: Ingo Molnar
31 Mar, 2009
4 commits
-
* reiserfs-updates: (35 commits)
reiserfs: rename [cn]_* variables
reiserfs: rename p_._ variables
reiserfs: rename p_s_tb to tb
reiserfs: rename p_s_inode to inode
reiserfs: rename p_s_bh to bh
reiserfs: rename p_s_sb to sb
reiserfs: strip trailing whitespace
reiserfs: cleanup path functions
reiserfs: factor out buffer_info initialization
reiserfs: add atomic addition of selinux attributes during inode creation
reiserfs: use generic readdir for operations across all xattrs
reiserfs: journaled xattrs
reiserfs: use generic xattr handlers
reiserfs: remove i_has_xattr_dir
reiserfs: make per-inode xattr locking more fine grained
reiserfs: eliminate per-super xattr lock
reiserfs: simplify xattr internal file lookups/opens
reiserfs: Clean up xattrs when REISERFS_FS_XATTR is unset
reiserfs: remove IS_PRIVATE helpers
reiserfs: remove link detection code
...Fixed up conflicts manually due to:
- quota name cleanups vs variable naming changes:
fs/reiserfs/inode.c
fs/reiserfs/namei.c
fs/reiserfs/stree.c
fs/reiserfs/xattr.c
- exported include header cleanups
include/linux/reiserfs_fs.h -
This patch makes many paths that are currently using warnings to handle
the error.Signed-off-by: Jeff Mahoney
Signed-off-by: Linus Torvalds -
ReiserFS warnings can be somewhat inconsistent.
In some cases:
* a unique identifier may be associated with it
* the function name may be included
* the device may be printed separatelyThis patch aims to make warnings more consistent. reiserfs_warning() prints
the device name, so printing it a second time is not required. The function
name for a warning is always helpful in debugging, so it is now automatically
inserted into the output. Hans has stated that every warning should have
a unique identifier. Some cases lack them, others really shouldn't have them.
reiserfs_warning() now expects an id associated with each message. In the
rare case where one isn't needed, "" will suffice.Signed-off-by: Jeff Mahoney
Signed-off-by: Linus Torvalds -
In several places, reiserfs_warning is used when there is no warning, just
a notice. This patch changes some of them to indicate that the message
is merely informational.Signed-off-by: Jeff Mahoney
Signed-off-by: Linus Torvalds
26 Mar, 2009
1 commit
-
Use lowercase names of quota functions instead of old uppercase ones.
Signed-off-by: Jan Kara
CC: reiserfs-devel@vger.kernel.org
28 Apr, 2008
1 commit
-
__FUNCTION__ is gcc-specific, use __func__
Signed-off-by: Harvey Harrison
Cc: Chris Mason
Cc: Jeff Mahoney
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
03 Feb, 2008
1 commit
-
Signed-off-by: Joe Perches
Signed-off-by: Adrian Bunk
20 Oct, 2007
4 commits
-
Implement support for file systems larger than 8 TiB.
The reiserfs superblock contains a 16 bit value for counting the number of
bitmap blocks. The rest of the disk format supports file systems up to 2^32
blocks, but the bitmap block limitation artificially limits this to 8 TiB with
a 4KiB block size.Rather than trust the superblock's 16-bit bitmap block count, we calculate it
dynamically based on the number of blocks in the file system. When an
incorrect value is observed in the superblock, it is zeroed out, ensuring that
older kernels will not be able to mount the file system.Userspace support has already been implemented and shipped in reiserfsprogs
3.6.20.Signed-off-by: Jeff Mahoney
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The first_zero_hint metadata caching was never actually used, and it's of
dubious optimization quality. This patch removes it.It doesn't actually shrink the size of the reiserfs_bitmap_info struct, since
that doesn't work with block sizes larger than 8K. There was a big fixme in
there, and with all the work lately in allowing block size > page size, I
might as well kill the fixme as well.Signed-off-by: Jeff Mahoney
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Do a quick signedness check for block numbers. There are a number of places
where signed integers are used for block numbers, which limits the usable file
system size to 8 TiB. The disk format, excepting a problem which will be
fixed in the following patch, supports file systems up to 16 TiB in size.
This patch cleans up those sites so that we can enable the full usable size.Signed-off-by: Jeff Mahoney
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Build in is_reusable() unconditionally and use it to catch corruption before
it reaches the block freeing paths.Signed-off-by: Jeff Mahoney
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Oct, 2007
1 commit
-
- remove the following no longer used functions:
- bitmap.c: reiserfs_claim_blocks_to_be_allocated()
- bitmap.c: reiserfs_release_claimed_blocks()
- bitmap.c: reiserfs_can_fit_pages()- make the following functions static:
- inode.c: restart_transaction()
- journal.c: reiserfs_async_progress_wait()Signed-off-by: Adrian Bunk
Acked-by: Vladimir V. Saveliev
Cc: Nick Piggin
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 Dec, 2006
1 commit
-
Rename Reiserfs's struct path to struct treepath to prevent name collision
between it and struct path from fs/namei.c.Signed-off-by: Josef "Jeff" Sipek
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Oct, 2006
1 commit
-
null pointer dereferencing in reiserfs_read_bitmap_block.
Signed-off-by: Alexander Zarochentsev
Cc: Jeff Mahoney
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Oct, 2006
5 commits
-
When a file system becomes fragmented (using MythTV, for example), the
bigalloc window searching ends up causing huge performance problems. In a
file system presented by a user experiencing this bug, the file system was
90% free, but no 32-block free windows existed on the entire file system.
This causes the allocator to scan the entire file system for each 128k
write before backing down to searching for individual blocks.In the end, finding a contiguous window for all the blocks in a write is an
advantageous special case, but one that can be found naturally when such a
window exists anyway.This patch removes the bigalloc window searching, and has been proven to
fix the test case described above.Signed-off-by: Jeff Mahoney
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This is the patch the three previous ones have been leading up to.
It changes the behavior of ReiserFS from loading and caching all the bitmaps
as special, to treating the bitmaps like any other bit of metadata and just
letting the system-wide caches figure out what to hang on to.Buffer heads are allocated on the fly, so there is no need to retain pointers
to all of them. The caching of the metadata occurs when the data is read and
updated, and is considered invalid and uncached until then.I needed to remove the vs-4040 check for performing a duplicate operation on a
particular bit. The reason is that while the other sites for working with
bitmaps are allowed to schedule, is_reusable() is called from do_balance(),
which will panic if a schedule occurs in certain places.The benefit of on-demand bitmaps clearly outweighs a sanity check that depends
on a compile-time option that is discouraged.[akpm@osdl.org: warning fix]
Signed-off-by: Jeff Mahoney
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch moves the bitmap loading code from super.c to bitmap.c
The code is also restructured somewhat. The only difference between new
format bitmaps and old format bitmaps is where they are. That's a two liner
before loading the block to use the correct one. There's no need for an
entirely separate code path.The load path is generally the same, with the pattern being to throw out a
bunch of requests and then wait for them, then cache the metadata from the
contents.Again, like the previous patches, the purpose is to set up for later ones.
Update: There was a bug in the previously posted version of this that resulted
in corruption. The problem was that bitmap 0 on new format file systems must
be treated specially, and wasn't. A stupid bug with an easy fix.This is hopefully the last fix for the disaster that is the reiserfs bitmap
patch set.If a bitmap block was full, first_zero_hint would end up at zero since it
would never be changed from it's zeroed out value. This just sets it
beyond the end of the bitmap block. If any bits are freed, it will be
reset to a valid bit. When info->free_count = 0, then we already know it's
full.Signed-off-by: Jeff Mahoney
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Similar to the SB_JOURNAL cleanup that was accepted a while ago, this patch
uses a temporary variable for buffer head references from the bitmap info
array.This makes the code much more readable in some areas.
It also uses proper reference counting, doing a get_bh() after using the
pointer from the array and brelse()'ing it later. This may seem silly, but a
later patch will replace the simple temporary variables with an actual read,
so the reference freeing will be used then.Signed-off-by: Jeff Mahoney
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
There is a check in is_reusable to determine if a particular block is a bitmap
block. It verifies this by going through the array of bitmap block buffer
heads and comparing the block number to each one.Bitmap blocks are at defined locations on the disk in both old and current
formats. Simply checking against the known good values is enough.This is a trivial optimization for a non-production codepath, but this is the
first in a series of patches that will ultimately remove the buffer heads from
that array.Signed-off-by: Jeff Mahoney
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Jul, 2006
1 commit
-
Signed-off-by: Jörn Engel
Signed-off-by: Adrian Bunk
13 Jul, 2005
1 commit
-
This was a pure indentation change, using:
scripts/Lindent fs/reiserfs/*.c include/linux/reiserfs_*.h
to make reiserfs match the regular Linux indentation style. As Jeff
Mahoney writes:The ReiserFS code is a mix of a number of different coding styles, sometimes
different even from line-to-line. Since the code has been relatively stable
for quite some time and there are few outstanding patches to be applied, it
is time to reformat the code to conform to the Linux style standard outlined
in Documentation/CodingStyle.This patch contains the result of running scripts/Lindent against
fs/reiserfs/*.c and include/linux/reiserfs_*.h. There are places where the
code can be made to look better, but I'd rather keep those patches separate
so that there isn't a subtle by-hand hand accident in the middle of a huge
patch. To be clear: This patch is reformatting *only*.A number of patches may follow that continue to make the code more consistent
with the Linux coding style.Hans wasn't particularly enthusiastic about these patches, but said he
wouldn't really oppose them either.Signed-off-by: Linus Torvalds
01 May, 2005
2 commits
-
little-endian objects annotated as such; again, obviously no changes of
resulting code, we only replace __u16 with __le16, etc. in relevant places.Signed-off-by: Al Viro
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
struct reiserfs_key cloned; (currently) identical struct in_core_key added.
Places that expect host-endian data in reiserfs_key switched to in_core_key.
Basically, we get annotation of reiserfs_key users and keep the resulting tree
obviously equivalent to original.Signed-off-by: Al Viro
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Apr, 2005
1 commit
-
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.Let it rip!