linux/fs/f2fs
Jaegeuk Kim d631abdac9 f2fs: fix recursive lock by f2fs_setxattr
This patch should resolve the following recursive lock.

[<ffffffff8135a9c3>] call_rwsem_down_write_failed+0x13/0x20
[<ffffffffa01749dc>] f2fs_setxattr+0x5c/0xa0 [f2fs]
[<ffffffffa0174c99>] __f2fs_set_acl+0x1b9/0x340 [f2fs]
[<ffffffffa017515a>] f2fs_init_acl+0x4a/0xcb [f2fs]
[<ffffffffa0159abe>] __f2fs_add_link+0x26e/0x780 [f2fs]
[<ffffffffa015d4d8>] f2fs_mkdir+0xb8/0x150 [f2fs]
[<ffffffff811cebd7>] vfs_mkdir+0xb7/0x160
[<ffffffff811cf89b>] SyS_mkdir+0xab/0xe0
[<ffffffff817244bf>] tracesys+0xe1/0xe6
[<ffffffffffffffff>] 0xffffffffffffffff

The call path indicates:
- f2fs_add_link
   : down_write(&fi->i_sem);

 - init_inode_metadata
   - f2fs_init_acl
     - __f2fs_set_acl
       - f2fs_setxattr
         : down_write(&fi->i_sem);

Here we should not call f2fs_setxattr, but __f2fs_setxattr.
But __f2fs_setxattr is a static function in xattr.c, so that I found the other
generic approach to use f2fs_setxattr.

In f2fs_setxattr, the page pointer is only given from init_inode_metadata.
So, this patch adds this condition to avoid this in f2fs_setxattr.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2014-06-02 22:13:16 +09:00
..
acl.c f2fs: pass flags field to setxattr functions 2014-05-07 10:21:56 +09:00
acl.h f2fs: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
checkpoint.c f2fs: add a tracepoint for f2fs_write_{meta,node,data}_pages 2014-05-07 10:21:59 +09:00
data.c f2fs: add a tracepoint for f2fs_read_data_page 2014-05-07 10:21:59 +09:00
debug.c f2fs: remove unnecessary threshold 2014-03-20 22:10:09 +09:00
dir.c f2fs: split grab_cache_page and wait_on_page_writeback for node pages 2014-05-07 10:21:58 +09:00
f2fs.h f2fs: fix to truncate inline data in inode page when setattr 2014-05-07 10:21:58 +09:00
file.c f2fs: fix to truncate inline data in inode page when setattr 2014-05-07 10:21:58 +09:00
gc.c f2fs: remove the unused ctor argument of f2fs_kmem_cache_create() 2014-03-10 18:45:14 +09:00
gc.h f2fs: add a sysfs entry to control max_victim_search 2014-01-08 13:45:08 +09:00
hash.c f2fs: unify string length declarations and usage 2012-12-28 11:27:53 +09:00
inline.c f2fs: avoid grab_cache_page_write_begin for data pages 2014-05-07 10:21:58 +09:00
inode.c f2fs: deactivate inode page if the inode is evicted 2014-05-07 10:21:58 +09:00
Kconfig f2fs: introduce CONFIG_F2FS_CHECK_FS for BUG_ON control 2013-10-29 15:43:01 +09:00
Makefile f2fs: key functions to handle inline data 2013-12-26 20:40:09 +09:00
namei.c f2fs: use inode_init_owner() to simplify codes 2014-05-08 18:23:21 +09:00
node.c f2fs: add a tracepoint for f2fs_write_{meta,node,data}_pages 2014-05-07 10:21:59 +09:00
node.h f2fs: fix checkpatch warning 2014-05-07 10:21:59 +09:00
recovery.c f2fs: set errno when f2fs_iget failed in recover_dentry 2014-05-07 10:21:57 +09:00
segment.c f2fs: avoid to use slab memory in f2fs_issue_flush for efficiency 2014-05-08 18:23:21 +09:00
segment.h f2fs: change reclaim rate in percentage 2014-03-20 22:10:10 +09:00
super.c f2fs: introduce help function {create,destroy}_flush_cmd_control 2014-05-07 10:21:57 +09:00
xattr.c f2fs: fix recursive lock by f2fs_setxattr 2014-06-02 22:13:16 +09:00
xattr.h f2fs: pass flags field to setxattr functions 2014-05-07 10:21:56 +09:00