Jaegeuk Kim dd802406e3 f2fs: avoid double lock for cp_rwsem
The __f2fs_add_link is covered by cp_rwsem all the time.
This calls init_inode_metadata, which conducts some acl operations including
memory allocation with GFP_KERNEL previously.
But, under memory pressure, f2fs_write_data_page can be called, which also
grabs cp_rwsem too.

In this case, this incurs a deadlock pointed by Chao.
Thread #1        Thread #2
 down_read
                 down_write
  down_read
 -> here down_read should wait forever.

Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2015-01-09 17:02:25 -08:00
..
2015-01-09 17:02:25 -08:00
2015-01-09 17:02:24 -08:00
2015-01-09 17:02:24 -08:00
2015-01-09 17:02:24 -08:00
2014-12-02 11:02:50 -08:00
2014-08-29 00:26:50 -07:00
2015-01-09 17:02:24 -08:00
2015-01-09 17:02:24 -08:00
2015-01-09 17:02:24 -08:00
2015-01-09 17:02:24 -08:00
2015-01-09 17:02:24 -08:00