From: Alex Elder Date: Wed, 3 Apr 2013 20:03:53 +0000 (-0500) Subject: ceph: use page_offset() in ceph_writepages_start() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=25d71cb92d8eb48df9cbd8cc4bb28e88ee8e88d9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ceph: use page_offset() in ceph_writepages_start() There's one spot in ceph_writepages_start() that open-codes what page_offset() does safely. Use the macro so we don't have to worry about wrapping. This resolves: http://tracker.ceph.com/issues/4648 Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 45745aae4786..ae438d02a422 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -900,7 +900,7 @@ get_more_pages: } /* submit the write */ - offset = req->r_data_out.pages[0]->index << PAGE_CACHE_SHIFT; + offset = page_offset(req->r_data_out.pages[0]); len = min((snap_size ? snap_size : i_size_read(inode)) - offset, (u64)locked_pages << PAGE_CACHE_SHIFT); dout("writepages got %d pages at %llu~%llu\n",