@@ -1153,13 +1153,57 @@ out:
return ERR_PTR(error);
}
+void __sb_writers_acquired(struct super_block *sb, int level)
+{
+ struct percpu_rw_semaphore *sem = sb->s_writers.rw_sem + level-1;
+ struct ltrace *lt = current->ltrace + level-1;
+
+ WARN_ON(percpu_rwsem_is_held(sem));
+
+ percpu_rwsem_acquire(sem, 1, _RET_IP_);
+
+ if (!lt->lock) {
+ lt->lock = sem;
+ save_stack_trace(<->trace);
+ }
+}
+EXPORT_SYMBOL(__sb_writers_acquired);
+
+void __sb_writers_release(struct super_block *sb, int level)
+{
+ struct percpu_rw_semaphore *sem = sb->s_writers.rw_sem + level-1;
+ struct ltrace *lt = current->ltrace + level-1;
+
+ WARN_ON(!lt->lock);
+
+ percpu_rwsem_release(sem, 1, _RET_IP_);
+
+ WARN_ON(percpu_rwsem_is_held(sem));
+ if (lt->lock == sem) {
+ lt->lock = NULL;
+ lt->trace.nr_entries = 0;
+ }
+}
+EXPORT_SYMBOL(__sb_writers_release);
+
+
/*
* This is an internal function, please use sb_end_{write,pagefault,intwrite}
* instead.
*/
void __sb_end_write(struct super_block *sb, int level)
{
+ struct percpu_rw_semaphore *sem = sb->s_writers.rw_sem + level-1;
+ struct ltrace *lt = current->ltrace + level-1;
+
+ WARN_ON(!lt->lock);
+
percpu_up_read(sb->s_writers.rw_sem + level-1);
+
+ if (lt->lock == sem && !percpu_rwsem_is_held(sem)) {
+ lt->lock = NULL;
+ lt->trace.nr_entries = 0;
+ }
}
EXPORT_SYMBOL(__sb_end_write);
@@ -1169,10 +1213,22 @@ EXPORT_SYMBOL(__sb_end_write);
*/
int __sb_start_write(struct super_block *sb, int level, bool wait)
{
+ struct percpu_rw_semaphore *sem = sb->s_writers.rw_sem + level-1;
+ struct ltrace *lt = current->ltrace + level-1;
bool force_trylock = false;
int ret = 1;
+ WARN_ON(lt->lock == sem && !percpu_rwsem_is_held(sem));
+
#ifdef CONFIG_LOCKDEP
+ if (wait && lt->lock == sem) {
+ pr_crit("XXXXX %s:%d lev=%d\n", current->comm, current->pid, level);
+ dump_stack();
+ debug_show_held_locks(current);
+ pr_crit("Prev Trace:\n");
+ print_stack_trace(<->trace, 0);
+ }
+
/*
* We want lockdep to tell us about possible deadlocks with freezing
* but it's it bit tricky to properly instrument it. Getting a freeze
@@ -1198,6 +1254,10 @@ int __sb_start_write(struct super_block *sb, int level, bool wait)
ret = percpu_down_read_trylock(sb->s_writers.rw_sem + level-1);
WARN_ON(force_trylock & !ret);
+ if (ret && !lt->lock) {
+ lt->lock = sem;
+ save_stack_trace(<->trace);
+ }
return ret;
}
EXPORT_SYMBOL(__sb_start_write);
@@ -614,7 +614,7 @@ xfs_log_mount(
int min_logfsbs;
if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) {
- xfs_notice(mp, "Mounting V%d Filesystem",
+ if (0) xfs_notice(mp, "Mounting V%d Filesystem",
XFS_SB_VERSION_NUM(&mp->m_sb));
} else {
xfs_notice(mp,
@@ -4607,7 +4607,7 @@ xlog_recover_finish(
: "internal");
log->l_flags &= ~XLOG_RECOVERY_NEEDED;
} else {
- xfs_info(log->l_mp, "Ending clean mount");
+ if (0) xfs_info(log->l_mp, "Ending clean mount");
}
return 0;
}
@@ -1573,7 +1573,7 @@ xfs_fs_put_super(
{
struct xfs_mount *mp = XFS_M(sb);
- xfs_notice(mp, "Unmounting Filesystem");
+ if (0) xfs_notice(mp, "Unmounting Filesystem");
xfs_filestream_unmount(mp);
xfs_unmountfs(mp);
@@ -1385,10 +1385,8 @@ extern struct timespec current_fs_time(struct super_block *sb);
void
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html