<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/reiserfs/super.c, branch v3.6-rc1</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>quota: Move quota syncing to -&gt;sync_fs method</title>
<updated>2012-07-22T19:58:34+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-07-03T14:45:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a1177825719ccef3f76ef39bbfd5ebb6087d53c7'/>
<id>a1177825719ccef3f76ef39bbfd5ebb6087d53c7</id>
<content type='text'>
Since the moment writes to quota files are using block device page cache and
space for quota structures is reserved at the moment they are first accessed we
have no reason to sync quota before inode writeback. In fact this order is now
only harmful since quota information can easily change during inode writeback
(either because conversion of delayed-allocated extents or simply because of
allocation of new blocks for simple filesystems not using page_mkwrite).

So move syncing of quota information after writeback of inodes into -&gt;sync_fs
method. This way we do not have to use -&gt;quota_sync callback which is primarily
intended for use by quotactl syscall anyway and we get rid of calling
-&gt;sync_fs() twice unnecessarily. We skip quota syncing for OCFS2 since it does
proper quota journalling in all cases (unlike ext3, ext4, and reiserfs which
also support legacy non-journalled quotas) and thus there are no dirty quota
structures.

CC: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
CC: Joel Becker &lt;jlbec@evilplan.org&gt;
CC: reiserfs-devel@vger.kernel.org
Acked-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
Acked-by: Dave Kleikamp &lt;shaggy@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the moment writes to quota files are using block device page cache and
space for quota structures is reserved at the moment they are first accessed we
have no reason to sync quota before inode writeback. In fact this order is now
only harmful since quota information can easily change during inode writeback
(either because conversion of delayed-allocated extents or simply because of
allocation of new blocks for simple filesystems not using page_mkwrite).

So move syncing of quota information after writeback of inodes into -&gt;sync_fs
method. This way we do not have to use -&gt;quota_sync callback which is primarily
intended for use by quotactl syscall anyway and we get rid of calling
-&gt;sync_fs() twice unnecessarily. We skip quota syncing for OCFS2 since it does
proper quota journalling in all cases (unlike ext3, ext4, and reiserfs which
also support legacy non-journalled quotas) and thus there are no dirty quota
structures.

CC: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
CC: Joel Becker &lt;jlbec@evilplan.org&gt;
CC: reiserfs-devel@vger.kernel.org
Acked-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
Acked-by: Dave Kleikamp &lt;shaggy@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>reiserfs: get rid of resierfs_sync_super</title>
<updated>2012-06-01T14:37:36+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2012-06-01T14:18:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=033369d1af1264abc23bea2e174aa47cdd212f6f'/>
<id>033369d1af1264abc23bea2e174aa47cdd212f6f</id>
<content type='text'>
This patch stops reiserfs using the VFS 'write_super()' method along with the
s_dirt flag, because they are on their way out.

The whole "superblock write-out" VFS infrastructure is served by the
'sync_supers()' kernel thread, which wakes up every 5 (by default) seconds and
writes out all dirty superblock using the '-&gt;write_super()' call-back.  But the
problem with this thread is that it wastes power by waking up the system every
5 seconds, even if there are no diry superblocks, or there are no client
file-systems which would need this (e.g., btrfs does not use
'-&gt;write_super()'). So we want to kill it completely and thus, we need to make
file-systems to stop using the '-&gt;write_super()' VFS service, and then remove
it together with the kernel thread.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch stops reiserfs using the VFS 'write_super()' method along with the
s_dirt flag, because they are on their way out.

The whole "superblock write-out" VFS infrastructure is served by the
'sync_supers()' kernel thread, which wakes up every 5 (by default) seconds and
writes out all dirty superblock using the '-&gt;write_super()' call-back.  But the
problem with this thread is that it wastes power by waking up the system every
5 seconds, even if there are no diry superblocks, or there are no client
file-systems which would need this (e.g., btrfs does not use
'-&gt;write_super()'). So we want to kill it completely and thus, we need to make
file-systems to stop using the '-&gt;write_super()' VFS service, and then remove
it together with the kernel thread.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>reiserfs: cleanup reiserfs_fill_super a bit</title>
<updated>2012-06-01T14:37:36+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2012-06-01T14:18:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=efaa33eb1309d65528d5a54d87d69bdcbdae8c10'/>
<id>efaa33eb1309d65528d5a54d87d69bdcbdae8c10</id>
<content type='text'>
We have the reiserfs superblock pointer in the 'sbi' variable in this
function, no need to use the 'REISERFS_SB(s)' macro which is the same.
This is jut a small clean-up.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have the reiserfs superblock pointer in the 'sbi' variable in this
function, no need to use the 'REISERFS_SB(s)' macro which is the same.
This is jut a small clean-up.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>reiserfs: Remove i_mutex use from reiserfs_quota_write()</title>
<updated>2012-05-15T21:34:38+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-04-25T19:28:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=67f1648d217c3b8165ca114c7838164f31e15790'/>
<id>67f1648d217c3b8165ca114c7838164f31e15790</id>
<content type='text'>
We don't need i_mutex in reiserfs_quota_write() because writes to quota file
are serialized by dqio_mutex anyway. Changes to quota files outside of quota
code are forbidded and enforced by NOATIME and IMMUTABLE bits.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We don't need i_mutex in reiserfs_quota_write() because writes to quota file
are serialized by dqio_mutex anyway. Changes to quota files outside of quota
code are forbidded and enforced by NOATIME and IMMUTABLE bits.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>move private bits of reiserfs_fs.h to fs/reiserfs/reiserfs.h</title>
<updated>2012-03-21T01:29:43+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-03-17T05:16:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f466c6fdb3b1f043ff1977a8d2a1d0cd4dc164fa'/>
<id>f466c6fdb3b1f043ff1977a8d2a1d0cd4dc164fa</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>move reiserfs_acl.h to fs/reiserfs/acl.h</title>
<updated>2012-03-21T01:29:42+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-03-17T05:03:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a3063ab88fcbe5249f841cb95dfd626b8bf2674f'/>
<id>a3063ab88fcbe5249f841cb95dfd626b8bf2674f</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>take private bits of reiserfs_xattr.h to fs/reiserfs/xattr.h</title>
<updated>2012-03-21T01:29:42+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-03-17T04:59:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c45ac8887e778c4fa2b572c51a94a681a0955d4d'/>
<id>c45ac8887e778c4fa2b572c51a94a681a0955d4d</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>switch open-coded instances of d_make_root() to new helper</title>
<updated>2012-03-21T01:29:35+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-01-09T03:15:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=48fde701aff662559b38d9a609574068f22d00fe'/>
<id>48fde701aff662559b38d9a609574068f22d00fe</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>reiserfs: don't lock root inode searching</title>
<updated>2012-01-11T00:30:54+00:00</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2012-01-10T23:11:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9b467e6ebebbe75288aeb7e816ffbb5d35d6eaa3'/>
<id>9b467e6ebebbe75288aeb7e816ffbb5d35d6eaa3</id>
<content type='text'>
Nothing requires that we lock the filesystem until the root inode is
provided.

Also iget5_locked() triggers a warning because we are holding the
filesystem lock while allocating the inode, which result in a lockdep
suspicion that we have a lock inversion against the reclaim path:

[ 1986.896979] =================================
[ 1986.896990] [ INFO: inconsistent lock state ]
[ 1986.896997] 3.1.1-main #8
[ 1986.897001] ---------------------------------
[ 1986.897007] inconsistent {RECLAIM_FS-ON-W} -&gt; {IN-RECLAIM_FS-W} usage.
[ 1986.897016] kswapd0/16 [HC0[0]:SC0[0]:HE1:SE1] takes:
[ 1986.897023]  (&amp;REISERFS_SB(s)-&gt;lock){+.+.?.}, at: [&lt;c01f8bd4&gt;] reiserfs_write_lock+0x20/0x2a
[ 1986.897044] {RECLAIM_FS-ON-W} state was registered at:
[ 1986.897050]   [&lt;c014a5b9&gt;] mark_held_locks+0xae/0xd0
[ 1986.897060]   [&lt;c014aab3&gt;] lockdep_trace_alloc+0x7d/0x91
[ 1986.897068]   [&lt;c0190ee0&gt;] kmem_cache_alloc+0x1a/0x93
[ 1986.897078]   [&lt;c01e7728&gt;] reiserfs_alloc_inode+0x13/0x3d
[ 1986.897088]   [&lt;c01a5b06&gt;] alloc_inode+0x14/0x5f
[ 1986.897097]   [&lt;c01a5cb9&gt;] iget5_locked+0x62/0x13a
[ 1986.897106]   [&lt;c01e99e0&gt;] reiserfs_fill_super+0x410/0x8b9
[ 1986.897114]   [&lt;c01953da&gt;] mount_bdev+0x10b/0x159
[ 1986.897123]   [&lt;c01e764d&gt;] get_super_block+0x10/0x12
[ 1986.897131]   [&lt;c0195b38&gt;] mount_fs+0x59/0x12d
[ 1986.897138]   [&lt;c01a80d1&gt;] vfs_kern_mount+0x45/0x7a
[ 1986.897147]   [&lt;c01a83e3&gt;] do_kern_mount+0x2f/0xb0
[ 1986.897155]   [&lt;c01a987a&gt;] do_mount+0x5c2/0x612
[ 1986.897163]   [&lt;c01a9a72&gt;] sys_mount+0x61/0x8f
[ 1986.897170]   [&lt;c044060c&gt;] sysenter_do_call+0x12/0x32
[ 1986.897181] irq event stamp: 7509691
[ 1986.897186] hardirqs last  enabled at (7509691): [&lt;c0190f34&gt;] kmem_cache_alloc+0x6e/0x93
[ 1986.897197] hardirqs last disabled at (7509690): [&lt;c0190eea&gt;] kmem_cache_alloc+0x24/0x93
[ 1986.897209] softirqs last  enabled at (7508896): [&lt;c01294bd&gt;] __do_softirq+0xee/0xfd
[ 1986.897222] softirqs last disabled at (7508859): [&lt;c01030ed&gt;] do_softirq+0x50/0x9d
[ 1986.897234]
[ 1986.897235] other info that might help us debug this:
[ 1986.897242]  Possible unsafe locking scenario:
[ 1986.897244]
[ 1986.897250]        CPU0
[ 1986.897254]        ----
[ 1986.897257]   lock(&amp;REISERFS_SB(s)-&gt;lock);
[ 1986.897265] &lt;Interrupt&gt;
[ 1986.897269]     lock(&amp;REISERFS_SB(s)-&gt;lock);
[ 1986.897276]
[ 1986.897277]  *** DEADLOCK ***
[ 1986.897278]
[ 1986.897286] no locks held by kswapd0/16.
[ 1986.897291]
[ 1986.897292] stack backtrace:
[ 1986.897299] Pid: 16, comm: kswapd0 Not tainted 3.1.1-main #8
[ 1986.897306] Call Trace:
[ 1986.897314]  [&lt;c0439e76&gt;] ? printk+0xf/0x11
[ 1986.897324]  [&lt;c01482d1&gt;] print_usage_bug+0x20e/0x21a
[ 1986.897332]  [&lt;c01479b8&gt;] ? print_irq_inversion_bug+0x172/0x172
[ 1986.897341]  [&lt;c014855c&gt;] mark_lock+0x27f/0x483
[ 1986.897349]  [&lt;c0148d88&gt;] __lock_acquire+0x628/0x1472
[ 1986.897358]  [&lt;c0149fae&gt;] lock_acquire+0x47/0x5e
[ 1986.897366]  [&lt;c01f8bd4&gt;] ? reiserfs_write_lock+0x20/0x2a
[ 1986.897384]  [&lt;c01f8bd4&gt;] ? reiserfs_write_lock+0x20/0x2a
[ 1986.897397]  [&lt;c043b5ef&gt;] mutex_lock_nested+0x35/0x26f
[ 1986.897409]  [&lt;c01f8bd4&gt;] ? reiserfs_write_lock+0x20/0x2a
[ 1986.897421]  [&lt;c01f8bd4&gt;] reiserfs_write_lock+0x20/0x2a
[ 1986.897433]  [&lt;c01e2edd&gt;] map_block_for_writepage+0xc9/0x590
[ 1986.897448]  [&lt;c01b1706&gt;] ? create_empty_buffers+0x33/0x8f
[ 1986.897461]  [&lt;c0121124&gt;] ? get_parent_ip+0xb/0x31
[ 1986.897472]  [&lt;c043ef7f&gt;] ? sub_preempt_count+0x81/0x8e
[ 1986.897485]  [&lt;c043cae0&gt;] ? _raw_spin_unlock+0x27/0x3d
[ 1986.897496]  [&lt;c0121124&gt;] ? get_parent_ip+0xb/0x31
[ 1986.897508]  [&lt;c01e355d&gt;] reiserfs_writepage+0x1b9/0x3e7
[ 1986.897521]  [&lt;c0173b40&gt;] ? clear_page_dirty_for_io+0xcb/0xde
[ 1986.897533]  [&lt;c014a6e3&gt;] ? trace_hardirqs_on_caller+0x108/0x138
[ 1986.897546]  [&lt;c014a71e&gt;] ? trace_hardirqs_on+0xb/0xd
[ 1986.897559]  [&lt;c0177b38&gt;] shrink_page_list+0x34f/0x5e2
[ 1986.897572]  [&lt;c01780a7&gt;] shrink_inactive_list+0x172/0x22c
[ 1986.897585]  [&lt;c0178464&gt;] shrink_zone+0x303/0x3b1
[ 1986.897597]  [&lt;c043cae0&gt;] ? _raw_spin_unlock+0x27/0x3d
[ 1986.897611]  [&lt;c01788c9&gt;] kswapd+0x3b7/0x5f2

The deadlock shouldn't happen since we are doing that allocation in the
mount path, the filesystem is not available for any reclaim.  Still the
warning is annoying.

To solve this, acquire the lock later only where we need it, right before
calling reiserfs_read_locked_inode() that wants to lock to walk the tree.

Reported-by: Knut Petersen &lt;Knut_Petersen@t-online.de&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Jeff Mahoney &lt;jeffm@suse.com&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Nothing requires that we lock the filesystem until the root inode is
provided.

Also iget5_locked() triggers a warning because we are holding the
filesystem lock while allocating the inode, which result in a lockdep
suspicion that we have a lock inversion against the reclaim path:

[ 1986.896979] =================================
[ 1986.896990] [ INFO: inconsistent lock state ]
[ 1986.896997] 3.1.1-main #8
[ 1986.897001] ---------------------------------
[ 1986.897007] inconsistent {RECLAIM_FS-ON-W} -&gt; {IN-RECLAIM_FS-W} usage.
[ 1986.897016] kswapd0/16 [HC0[0]:SC0[0]:HE1:SE1] takes:
[ 1986.897023]  (&amp;REISERFS_SB(s)-&gt;lock){+.+.?.}, at: [&lt;c01f8bd4&gt;] reiserfs_write_lock+0x20/0x2a
[ 1986.897044] {RECLAIM_FS-ON-W} state was registered at:
[ 1986.897050]   [&lt;c014a5b9&gt;] mark_held_locks+0xae/0xd0
[ 1986.897060]   [&lt;c014aab3&gt;] lockdep_trace_alloc+0x7d/0x91
[ 1986.897068]   [&lt;c0190ee0&gt;] kmem_cache_alloc+0x1a/0x93
[ 1986.897078]   [&lt;c01e7728&gt;] reiserfs_alloc_inode+0x13/0x3d
[ 1986.897088]   [&lt;c01a5b06&gt;] alloc_inode+0x14/0x5f
[ 1986.897097]   [&lt;c01a5cb9&gt;] iget5_locked+0x62/0x13a
[ 1986.897106]   [&lt;c01e99e0&gt;] reiserfs_fill_super+0x410/0x8b9
[ 1986.897114]   [&lt;c01953da&gt;] mount_bdev+0x10b/0x159
[ 1986.897123]   [&lt;c01e764d&gt;] get_super_block+0x10/0x12
[ 1986.897131]   [&lt;c0195b38&gt;] mount_fs+0x59/0x12d
[ 1986.897138]   [&lt;c01a80d1&gt;] vfs_kern_mount+0x45/0x7a
[ 1986.897147]   [&lt;c01a83e3&gt;] do_kern_mount+0x2f/0xb0
[ 1986.897155]   [&lt;c01a987a&gt;] do_mount+0x5c2/0x612
[ 1986.897163]   [&lt;c01a9a72&gt;] sys_mount+0x61/0x8f
[ 1986.897170]   [&lt;c044060c&gt;] sysenter_do_call+0x12/0x32
[ 1986.897181] irq event stamp: 7509691
[ 1986.897186] hardirqs last  enabled at (7509691): [&lt;c0190f34&gt;] kmem_cache_alloc+0x6e/0x93
[ 1986.897197] hardirqs last disabled at (7509690): [&lt;c0190eea&gt;] kmem_cache_alloc+0x24/0x93
[ 1986.897209] softirqs last  enabled at (7508896): [&lt;c01294bd&gt;] __do_softirq+0xee/0xfd
[ 1986.897222] softirqs last disabled at (7508859): [&lt;c01030ed&gt;] do_softirq+0x50/0x9d
[ 1986.897234]
[ 1986.897235] other info that might help us debug this:
[ 1986.897242]  Possible unsafe locking scenario:
[ 1986.897244]
[ 1986.897250]        CPU0
[ 1986.897254]        ----
[ 1986.897257]   lock(&amp;REISERFS_SB(s)-&gt;lock);
[ 1986.897265] &lt;Interrupt&gt;
[ 1986.897269]     lock(&amp;REISERFS_SB(s)-&gt;lock);
[ 1986.897276]
[ 1986.897277]  *** DEADLOCK ***
[ 1986.897278]
[ 1986.897286] no locks held by kswapd0/16.
[ 1986.897291]
[ 1986.897292] stack backtrace:
[ 1986.897299] Pid: 16, comm: kswapd0 Not tainted 3.1.1-main #8
[ 1986.897306] Call Trace:
[ 1986.897314]  [&lt;c0439e76&gt;] ? printk+0xf/0x11
[ 1986.897324]  [&lt;c01482d1&gt;] print_usage_bug+0x20e/0x21a
[ 1986.897332]  [&lt;c01479b8&gt;] ? print_irq_inversion_bug+0x172/0x172
[ 1986.897341]  [&lt;c014855c&gt;] mark_lock+0x27f/0x483
[ 1986.897349]  [&lt;c0148d88&gt;] __lock_acquire+0x628/0x1472
[ 1986.897358]  [&lt;c0149fae&gt;] lock_acquire+0x47/0x5e
[ 1986.897366]  [&lt;c01f8bd4&gt;] ? reiserfs_write_lock+0x20/0x2a
[ 1986.897384]  [&lt;c01f8bd4&gt;] ? reiserfs_write_lock+0x20/0x2a
[ 1986.897397]  [&lt;c043b5ef&gt;] mutex_lock_nested+0x35/0x26f
[ 1986.897409]  [&lt;c01f8bd4&gt;] ? reiserfs_write_lock+0x20/0x2a
[ 1986.897421]  [&lt;c01f8bd4&gt;] reiserfs_write_lock+0x20/0x2a
[ 1986.897433]  [&lt;c01e2edd&gt;] map_block_for_writepage+0xc9/0x590
[ 1986.897448]  [&lt;c01b1706&gt;] ? create_empty_buffers+0x33/0x8f
[ 1986.897461]  [&lt;c0121124&gt;] ? get_parent_ip+0xb/0x31
[ 1986.897472]  [&lt;c043ef7f&gt;] ? sub_preempt_count+0x81/0x8e
[ 1986.897485]  [&lt;c043cae0&gt;] ? _raw_spin_unlock+0x27/0x3d
[ 1986.897496]  [&lt;c0121124&gt;] ? get_parent_ip+0xb/0x31
[ 1986.897508]  [&lt;c01e355d&gt;] reiserfs_writepage+0x1b9/0x3e7
[ 1986.897521]  [&lt;c0173b40&gt;] ? clear_page_dirty_for_io+0xcb/0xde
[ 1986.897533]  [&lt;c014a6e3&gt;] ? trace_hardirqs_on_caller+0x108/0x138
[ 1986.897546]  [&lt;c014a71e&gt;] ? trace_hardirqs_on+0xb/0xd
[ 1986.897559]  [&lt;c0177b38&gt;] shrink_page_list+0x34f/0x5e2
[ 1986.897572]  [&lt;c01780a7&gt;] shrink_inactive_list+0x172/0x22c
[ 1986.897585]  [&lt;c0178464&gt;] shrink_zone+0x303/0x3b1
[ 1986.897597]  [&lt;c043cae0&gt;] ? _raw_spin_unlock+0x27/0x3d
[ 1986.897611]  [&lt;c01788c9&gt;] kswapd+0x3b7/0x5f2

The deadlock shouldn't happen since we are doing that allocation in the
mount path, the filesystem is not available for any reclaim.  Still the
warning is annoying.

To solve this, acquire the lock later only where we need it, right before
calling reiserfs_read_locked_inode() that wants to lock to walk the tree.

Reported-by: Knut Petersen &lt;Knut_Petersen@t-online.de&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Jeff Mahoney &lt;jeffm@suse.com&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>reiserfs: don't lock journal_init()</title>
<updated>2012-01-11T00:30:53+00:00</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2012-01-10T23:11:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=37c69b98d0dca54d9eb72226bbf2e211aaaf126e'/>
<id>37c69b98d0dca54d9eb72226bbf2e211aaaf126e</id>
<content type='text'>
journal_init() doesn't need the lock since no operation on the filesystem
is involved there.  journal_read() and get_list_bitmap() have yet to be
reviewed carefully though before removing the lock there.  Just keep the
it around these two calls for safety.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Jeff Mahoney &lt;jeffm@suse.com&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
journal_init() doesn't need the lock since no operation on the filesystem
is involved there.  journal_read() and get_list_bitmap() have yet to be
reviewed carefully though before removing the lock there.  Just keep the
it around these two calls for safety.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Jeff Mahoney &lt;jeffm@suse.com&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
