We could end up racing with a call to set or clear the Uptodate flag prior to taking the page lock. Use find_lock_page instead to have it return a locked page and unlock it before releasing it if it's not Uptodate. Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx> --- fs/ceph/addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 4606da82da6f..83b1f6dccab8 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1715,12 +1715,12 @@ int ceph_uninline_data(struct inode *inode, struct page *provided_page) WARN_ON(!PageUptodate(page)); } else if (ceph_caps_issued(ci) & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) { - page = find_get_page(inode->i_mapping, 0); + page = find_lock_page(inode->i_mapping, 0); if (page) { if (PageUptodate(page)) { from_pagecache = true; - lock_page(page); } else { + unlock_page(page); put_page(page); page = NULL; } -- 2.21.0