From 2ed2d5b33cb564025b1eb90650d70a0a3592c0e3 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Mon, 28 Oct 2013 13:17:54 +0900 Subject: 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 Signed-off-by: Jaegeuk Kim --- fs/f2fs/acl.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/f2fs/acl.h') 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 { extern struct posix_acl *f2fs_get_acl(struct inode *, int); extern int f2fs_acl_chmod(struct inode *); -extern int f2fs_init_acl(struct inode *, struct inode *); +extern int f2fs_init_acl(struct inode *, struct inode *, struct page *); #else #define f2fs_check_acl NULL #define f2fs_get_acl NULL @@ -49,7 +49,8 @@ static inline int f2fs_acl_chmod(struct inode *inode) return 0; } -static inline int f2fs_init_acl(struct inode *inode, struct inode *dir) +static inline int f2fs_init_acl(struct inode *inode, struct inode *dir, + struct page *page) { return 0; } -- cgit v1.2.3