Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ceph-for-4.13-rc8' of git://github.com/ceph/ceph-client

Pull ceph fix from Ilya Dryomov:
"ceph fscache page locking fix from Zheng, marked for stable"

* tag 'ceph-for-4.13-rc8' of git://github.com/ceph/ceph-client:
ceph: fix readpage from fscache

+18 -18
+15 -9
fs/ceph/addr.c
··· 189 189 /* 190 190 * read a single page, without unlocking it. 191 191 */ 192 - static int readpage_nounlock(struct file *filp, struct page *page) 192 + static int ceph_do_readpage(struct file *filp, struct page *page) 193 193 { 194 194 struct inode *inode = file_inode(filp); 195 195 struct ceph_inode_info *ci = ceph_inode(inode); ··· 219 219 220 220 err = ceph_readpage_from_fscache(inode, page); 221 221 if (err == 0) 222 - goto out; 222 + return -EINPROGRESS; 223 223 224 224 dout("readpage inode %p file %p page %p index %lu\n", 225 225 inode, filp, page, page->index); ··· 249 249 250 250 static int ceph_readpage(struct file *filp, struct page *page) 251 251 { 252 - int r = readpage_nounlock(filp, page); 253 - unlock_page(page); 252 + int r = ceph_do_readpage(filp, page); 253 + if (r != -EINPROGRESS) 254 + unlock_page(page); 255 + else 256 + r = 0; 254 257 return r; 255 258 } 256 259 ··· 1240 1237 goto retry_locked; 1241 1238 r = writepage_nounlock(page, NULL); 1242 1239 if (r < 0) 1243 - goto fail_nosnap; 1240 + goto fail_unlock; 1244 1241 goto retry_locked; 1245 1242 } 1246 1243 ··· 1268 1265 } 1269 1266 1270 1267 /* we need to read it. */ 1271 - r = readpage_nounlock(file, page); 1272 - if (r < 0) 1273 - goto fail_nosnap; 1268 + r = ceph_do_readpage(file, page); 1269 + if (r < 0) { 1270 + if (r == -EINPROGRESS) 1271 + return -EAGAIN; 1272 + goto fail_unlock; 1273 + } 1274 1274 goto retry_locked; 1275 - fail_nosnap: 1275 + fail_unlock: 1276 1276 unlock_page(page); 1277 1277 return r; 1278 1278 }
+3 -9
fs/ceph/cache.c
··· 297 297 } 298 298 } 299 299 300 - static void ceph_vfs_readpage_complete(struct page *page, void *data, int error) 301 - { 302 - if (!error) 303 - SetPageUptodate(page); 304 - } 305 - 306 - static void ceph_vfs_readpage_complete_unlock(struct page *page, void *data, int error) 300 + static void ceph_readpage_from_fscache_complete(struct page *page, void *data, int error) 307 301 { 308 302 if (!error) 309 303 SetPageUptodate(page); ··· 325 331 return -ENOBUFS; 326 332 327 333 ret = fscache_read_or_alloc_page(ci->fscache, page, 328 - ceph_vfs_readpage_complete, NULL, 334 + ceph_readpage_from_fscache_complete, NULL, 329 335 GFP_KERNEL); 330 336 331 337 switch (ret) { ··· 354 360 return -ENOBUFS; 355 361 356 362 ret = fscache_read_or_alloc_pages(ci->fscache, mapping, pages, nr_pages, 357 - ceph_vfs_readpage_complete_unlock, 363 + ceph_readpage_from_fscache_complete, 358 364 NULL, mapping_gfp_mask(mapping)); 359 365 360 366 switch (ret) {