f2fs: fix a deadlock during init_acl procedure
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 28 Oct 2013 04:17:54 +0000 (13:17 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 28 Oct 2013 04:39:09 +0000 (13:39 +0900)
commit2ed2d5b33cb564025b1eb90650d70a0a3592c0e3
tree650796f8962c82818464f1c03feecbc9d0bc551f
parentb8b60e1a65893728ca868493cb4c4b64b55e7f9c
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>
fs/f2fs/acl.c
fs/f2fs/acl.h
fs/f2fs/dir.c
This page took 0.025268 seconds and 5 git commands to generate.