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-5.15-rc7' of git://github.com/ceph/ceph-client

Pull ceph fixes from Ilya Dryomov:
"Two important filesystem fixes, marked for stable.

The blocklisted superblocks issue was particularly annoying because
for unexperienced users it essentially exacted a reboot to establish a
new functional mount in that scenario"

* tag 'ceph-for-5.15-rc7' of git://github.com/ceph/ceph-client:
ceph: fix handling of "meta" errors
ceph: skip existing superblocks that are blocklisted or shut down when mounting

+22 -30
+3 -9
fs/ceph/caps.c
··· 2330 2330 2331 2331 int ceph_fsync(struct file *file, loff_t start, loff_t end, int datasync) 2332 2332 { 2333 - struct ceph_file_info *fi = file->private_data; 2334 2333 struct inode *inode = file->f_mapping->host; 2335 2334 struct ceph_inode_info *ci = ceph_inode(inode); 2336 2335 u64 flush_tid; ··· 2364 2365 if (err < 0) 2365 2366 ret = err; 2366 2367 2367 - if (errseq_check(&ci->i_meta_err, READ_ONCE(fi->meta_err))) { 2368 - spin_lock(&file->f_lock); 2369 - err = errseq_check_and_advance(&ci->i_meta_err, 2370 - &fi->meta_err); 2371 - spin_unlock(&file->f_lock); 2372 - if (err < 0) 2373 - ret = err; 2374 - } 2368 + err = file_check_and_advance_wb_err(file); 2369 + if (err < 0) 2370 + ret = err; 2375 2371 out: 2376 2372 dout("fsync %p%s result=%d\n", inode, datasync ? " datasync" : "", ret); 2377 2373 return ret;
-1
fs/ceph/file.c
··· 233 233 234 234 spin_lock_init(&fi->rw_contexts_lock); 235 235 INIT_LIST_HEAD(&fi->rw_contexts); 236 - fi->meta_err = errseq_sample(&ci->i_meta_err); 237 236 fi->filp_gen = READ_ONCE(ceph_inode_to_client(inode)->filp_gen); 238 237 239 238 return 0;
-2
fs/ceph/inode.c
··· 541 541 542 542 ceph_fscache_inode_init(ci); 543 543 544 - ci->i_meta_err = 0; 545 - 546 544 return &ci->vfs_inode; 547 545 } 548 546
+5 -12
fs/ceph/mds_client.c
··· 1493 1493 { 1494 1494 struct ceph_mds_request *req; 1495 1495 struct rb_node *p; 1496 - struct ceph_inode_info *ci; 1497 1496 1498 1497 dout("cleanup_session_requests mds%d\n", session->s_mds); 1499 1498 mutex_lock(&mdsc->mutex); ··· 1501 1502 struct ceph_mds_request, r_unsafe_item); 1502 1503 pr_warn_ratelimited(" dropping unsafe request %llu\n", 1503 1504 req->r_tid); 1504 - if (req->r_target_inode) { 1505 - /* dropping unsafe change of inode's attributes */ 1506 - ci = ceph_inode(req->r_target_inode); 1507 - errseq_set(&ci->i_meta_err, -EIO); 1508 - } 1509 - if (req->r_unsafe_dir) { 1510 - /* dropping unsafe directory operation */ 1511 - ci = ceph_inode(req->r_unsafe_dir); 1512 - errseq_set(&ci->i_meta_err, -EIO); 1513 - } 1505 + if (req->r_target_inode) 1506 + mapping_set_error(req->r_target_inode->i_mapping, -EIO); 1507 + if (req->r_unsafe_dir) 1508 + mapping_set_error(req->r_unsafe_dir->i_mapping, -EIO); 1514 1509 __unregister_request(mdsc, req); 1515 1510 } 1516 1511 /* zero r_attempts, so kick_requests() will re-send requests */ ··· 1671 1678 spin_unlock(&mdsc->cap_dirty_lock); 1672 1679 1673 1680 if (dirty_dropped) { 1674 - errseq_set(&ci->i_meta_err, -EIO); 1681 + mapping_set_error(inode->i_mapping, -EIO); 1675 1682 1676 1683 if (ci->i_wrbuffer_ref_head == 0 && 1677 1684 ci->i_wr_ref == 0 &&
+14 -3
fs/ceph/super.c
··· 1002 1002 struct ceph_fs_client *new = fc->s_fs_info; 1003 1003 struct ceph_mount_options *fsopt = new->mount_options; 1004 1004 struct ceph_options *opt = new->client->options; 1005 - struct ceph_fs_client *other = ceph_sb_to_client(sb); 1005 + struct ceph_fs_client *fsc = ceph_sb_to_client(sb); 1006 1006 1007 1007 dout("ceph_compare_super %p\n", sb); 1008 1008 1009 - if (compare_mount_options(fsopt, opt, other)) { 1009 + if (compare_mount_options(fsopt, opt, fsc)) { 1010 1010 dout("monitor(s)/mount options don't match\n"); 1011 1011 return 0; 1012 1012 } 1013 1013 if ((opt->flags & CEPH_OPT_FSID) && 1014 - ceph_fsid_compare(&opt->fsid, &other->client->fsid)) { 1014 + ceph_fsid_compare(&opt->fsid, &fsc->client->fsid)) { 1015 1015 dout("fsid doesn't match\n"); 1016 1016 return 0; 1017 1017 } ··· 1019 1019 dout("flags differ\n"); 1020 1020 return 0; 1021 1021 } 1022 + 1023 + if (fsc->blocklisted && !ceph_test_mount_opt(fsc, CLEANRECOVER)) { 1024 + dout("client is blocklisted (and CLEANRECOVER is not set)\n"); 1025 + return 0; 1026 + } 1027 + 1028 + if (fsc->mount_state == CEPH_MOUNT_SHUTDOWN) { 1029 + dout("client has been forcibly unmounted\n"); 1030 + return 0; 1031 + } 1032 + 1022 1033 return 1; 1023 1034 } 1024 1035
-3
fs/ceph/super.h
··· 429 429 #ifdef CONFIG_CEPH_FSCACHE 430 430 struct fscache_cookie *fscache; 431 431 #endif 432 - errseq_t i_meta_err; 433 - 434 432 struct inode vfs_inode; /* at end */ 435 433 }; 436 434 ··· 772 774 spinlock_t rw_contexts_lock; 773 775 struct list_head rw_contexts; 774 776 775 - errseq_t meta_err; 776 777 u32 filp_gen; 777 778 atomic_t num_locks; 778 779 };