mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
Merge branch 'reiserfs/kill-bkl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing
* 'reiserfs/kill-bkl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing: reiserfs: Safely acquire i_mutex from xattr_rmdir reiserfs: Safely acquire i_mutex from reiserfs_for_each_xattr reiserfs: Fix journal mutex <-> inode mutex lock inversion reiserfs: Fix unwanted recursive reiserfs lock in reiserfs_unlink() reiserfs: Relax lock before open xattr dir in reiserfs_xattr_set_handle() reiserfs: Relax reiserfs lock while freeing the journal reiserfs: Fix reiserfs lock <-> i_mutex dependency inversion on xattr reiserfs: Warn on lock relax if taken recursively reiserfs: Fix reiserfs lock <-> i_xattr_sem dependency inversion reiserfs: Fix remaining in-reclaim-fs <-> reclaim-fs-on locking inversion reiserfs: Fix reiserfs lock <-> inode mutex dependency inversion reiserfs: Fix reiserfs lock and journal lock inversion dependency reiserfs: Fix possible recursive lock
This commit is contained in:
commit
45d28b0972
7 changed files with 79 additions and 15 deletions
|
@ -62,6 +62,12 @@ void reiserfs_write_unlock(struct super_block *s);
|
|||
int reiserfs_write_lock_once(struct super_block *s);
|
||||
void reiserfs_write_unlock_once(struct super_block *s, int lock_depth);
|
||||
|
||||
#ifdef CONFIG_REISERFS_CHECK
|
||||
void reiserfs_lock_check_recursive(struct super_block *s);
|
||||
#else
|
||||
static inline void reiserfs_lock_check_recursive(struct super_block *s) { }
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Several mutexes depend on the write lock.
|
||||
* However sometimes we want to relax the write lock while we hold
|
||||
|
@ -92,11 +98,31 @@ void reiserfs_write_unlock_once(struct super_block *s, int lock_depth);
|
|||
static inline void reiserfs_mutex_lock_safe(struct mutex *m,
|
||||
struct super_block *s)
|
||||
{
|
||||
reiserfs_lock_check_recursive(s);
|
||||
reiserfs_write_unlock(s);
|
||||
mutex_lock(m);
|
||||
reiserfs_write_lock(s);
|
||||
}
|
||||
|
||||
static inline void
|
||||
reiserfs_mutex_lock_nested_safe(struct mutex *m, unsigned int subclass,
|
||||
struct super_block *s)
|
||||
{
|
||||
reiserfs_lock_check_recursive(s);
|
||||
reiserfs_write_unlock(s);
|
||||
mutex_lock_nested(m, subclass);
|
||||
reiserfs_write_lock(s);
|
||||
}
|
||||
|
||||
static inline void
|
||||
reiserfs_down_read_safe(struct rw_semaphore *sem, struct super_block *s)
|
||||
{
|
||||
reiserfs_lock_check_recursive(s);
|
||||
reiserfs_write_unlock(s);
|
||||
down_read(sem);
|
||||
reiserfs_write_lock(s);
|
||||
}
|
||||
|
||||
/*
|
||||
* When we schedule, we usually want to also release the write lock,
|
||||
* according to the previous bkl based locking scheme of reiserfs.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue