ceph: fix capsnap dirty pages accounting

writepages_finish() calls ceph_put_wrbuffer_cap_refs() once for
all pages, parameter snapc is set to req->r_snapc. So writepages()
shouldn't write dirty pages associated with different snapc in
one OSD request.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

Yan, Zheng and committed by
Ilya Dryomov
7e1ee54a 2a2d927e

+2 -2
+2 -2
fs/ceph/addr.c
··· 930 931 /* only if matching snap context */ 932 pgsnapc = page_snap_context(page); 933 - if (pgsnapc->seq > snapc->seq) { 934 - dout("page snapc %p %lld > oldest %p %lld\n", 935 pgsnapc, pgsnapc->seq, snapc, snapc->seq); 936 unlock_page(page); 937 continue;
··· 930 931 /* only if matching snap context */ 932 pgsnapc = page_snap_context(page); 933 + if (pgsnapc != snapc) { 934 + dout("page snapc %p %lld != oldest %p %lld\n", 935 pgsnapc, pgsnapc->seq, snapc, snapc->seq); 936 unlock_page(page); 937 continue;