aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/acl.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-10-28 00:17:54 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-10-28 00:39:09 -0400
commit2ed2d5b33cb564025b1eb90650d70a0a3592c0e3 (patch)
tree650796f8962c82818464f1c03feecbc9d0bc551f /fs/f2fs/acl.h
parentb8b60e1a65893728ca868493cb4c4b64b55e7f9c (diff)
f2fs: fix a deadlock during init_acl procedure
The deadlock is found through the following scenario. sys_mkdir() -> f2fs_add_link() -> __f2fs_add_link() -> init_inode_metadata() : lock_page(inode); -> f2fs_init_acl() -> f2fs_set_acl() -> f2fs_setxattr(..., NULL) : This NULL page incurs a deadlock at update_inode_page(). So, likewise f2fs_init_security(), this patch adds a parameter to transfer the locked inode page to f2fs_setxattr(). Found by Linux File System Verification project (linuxtesting.org). Reported-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/acl.h')
-rw-r--r--fs/f2fs/acl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/acl.h b/fs/f2fs/acl.h
index 3839048f2e96..49633131e038 100644
--- a/fs/f2fs/acl.h
+++ b/fs/f2fs/acl.h
@@ -38,7 +38,7 @@ struct f2fs_acl_header {
38 38
39extern struct posix_acl *f2fs_get_acl(struct inode *, int); 39extern struct posix_acl *f2fs_get_acl(struct inode *, int);
40extern int f2fs_acl_chmod(struct inode *); 40extern int f2fs_acl_chmod(struct inode *);
41extern int f2fs_init_acl(struct inode *, struct inode *); 41extern int f2fs_init_acl(struct inode *, struct inode *, struct page *);
42#else 42#else
43#define f2fs_check_acl NULL 43#define f2fs_check_acl NULL
44#define f2fs_get_acl NULL 44#define f2fs_get_acl NULL
@@ -49,7 +49,8 @@ static inline int f2fs_acl_chmod(struct inode *inode)
49 return 0; 49 return 0;
50} 50}
51 51
52static inline int f2fs_init_acl(struct inode *inode, struct inode *dir) 52static inline int f2fs_init_acl(struct inode *inode, struct inode *dir,
53 struct page *page)
53{ 54{
54 return 0; 55 return 0;
55} 56}