ceph: don't call truncate_pagecache in ceph_writepages_start
authorYan, Zheng <zyan@redhat.com>
Fri, 15 Apr 2016 05:56:12 +0000 (13:56 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 25 May 2016 23:15:32 +0000 (01:15 +0200)
commit6c93df5db628e710697c43bc1bd78a786549a548
tree8f74edaae6bfb61178af444a9c68fc5cf791f8da
parent77310320c299b0dc050037ff8fc29fd1861fb005
ceph: don't call truncate_pagecache in ceph_writepages_start

truncate_pagecache() may decrease inode's reference. This can cause
deadlock if inode's last reference is dropped and iput_final() wants
to evict the inode. (evict() calls inode_wait_for_writeback(), which
waits for ceph_writepages_start() to return).

The fix is use work thead to truncate dirty pages. Also add 'forced
umount' check to ceph_update_writeable_page(), which prevents new
pages getting dirty.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
fs/ceph/addr.c
fs/ceph/inode.c
fs/ceph/mds_client.c