From d631abdac9d541d282a1461b5aeae70aa3866e9f Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Sun, 1 Jun 2014 23:24:30 +0900 Subject: [PATCH] f2fs: fix recursive lock by f2fs_setxattr This patch should resolve the following recursive lock. [] call_rwsem_down_write_failed+0x13/0x20 [] f2fs_setxattr+0x5c/0xa0 [f2fs] [] __f2fs_set_acl+0x1b9/0x340 [f2fs] [] f2fs_init_acl+0x4a/0xcb [f2fs] [] __f2fs_add_link+0x26e/0x780 [f2fs] [] f2fs_mkdir+0xb8/0x150 [f2fs] [] vfs_mkdir+0xb7/0x160 [] SyS_mkdir+0xab/0xe0 [] tracesys+0xe1/0xe6 [] 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 --- Reading git-format-patch failed