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

Pull ceph fix from Ilya Dryomov:
"Two fixes to properly maintain xattrs on async creates and thus
preserve SELinux context on newly created files and to avoid improper
usage of folio->private field which triggered BUG_ONs.

Both marked for stable"

* tag 'ceph-for-5.18-rc7' of https://github.com/ceph/ceph-client:
ceph: check folio PG_private bit instead of folio->private
ceph: fix setting of xattrs on async created inodes

+20 -7
+7 -4
fs/ceph/addr.c
··· 85 85 if (folio_test_dirty(folio)) { 86 86 dout("%p dirty_folio %p idx %lu -- already dirty\n", 87 87 mapping->host, folio, folio->index); 88 - BUG_ON(!folio_get_private(folio)); 88 + VM_BUG_ON_FOLIO(!folio_test_private(folio), folio); 89 89 return false; 90 90 } 91 91 ··· 122 122 * Reference snap context in folio->private. Also set 123 123 * PagePrivate so that we get invalidate_folio callback. 124 124 */ 125 - BUG_ON(folio_get_private(folio)); 125 + VM_BUG_ON_FOLIO(folio_test_private(folio), folio); 126 126 folio_attach_private(folio, snapc); 127 127 128 128 return ceph_fscache_dirty_folio(mapping, folio); ··· 150 150 } 151 151 152 152 WARN_ON(!folio_test_locked(folio)); 153 - if (folio_get_private(folio)) { 153 + if (folio_test_private(folio)) { 154 154 dout("%p invalidate_folio idx %lu full dirty page\n", 155 155 inode, folio->index); 156 156 ··· 729 729 730 730 /* clean all pages */ 731 731 for (i = 0; i < req->r_num_ops; i++) { 732 - if (req->r_ops[i].op != CEPH_OSD_OP_WRITE) 732 + if (req->r_ops[i].op != CEPH_OSD_OP_WRITE) { 733 + pr_warn("%s incorrect op %d req %p index %d tid %llu\n", 734 + __func__, req->r_ops[i].op, req, i, req->r_tid); 733 735 break; 736 + } 734 737 735 738 osd_data = osd_req_op_extent_osd_data(req, i); 736 739 BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_PAGES);
+13 -3
fs/ceph/file.c
··· 629 629 iinfo.change_attr = 1; 630 630 ceph_encode_timespec64(&iinfo.btime, &now); 631 631 632 - iinfo.xattr_len = ARRAY_SIZE(xattr_buf); 633 - iinfo.xattr_data = xattr_buf; 634 - memset(iinfo.xattr_data, 0, iinfo.xattr_len); 632 + if (req->r_pagelist) { 633 + iinfo.xattr_len = req->r_pagelist->length; 634 + iinfo.xattr_data = req->r_pagelist->mapped_tail; 635 + } else { 636 + /* fake it */ 637 + iinfo.xattr_len = ARRAY_SIZE(xattr_buf); 638 + iinfo.xattr_data = xattr_buf; 639 + memset(iinfo.xattr_data, 0, iinfo.xattr_len); 640 + } 635 641 636 642 in.ino = cpu_to_le64(vino.ino); 637 643 in.snapid = cpu_to_le64(CEPH_NOSNAP); ··· 749 743 err = ceph_security_init_secctx(dentry, mode, &as_ctx); 750 744 if (err < 0) 751 745 goto out_ctx; 746 + /* Async create can't handle more than a page of xattrs */ 747 + if (as_ctx.pagelist && 748 + !list_is_singular(&as_ctx.pagelist->head)) 749 + try_async = false; 752 750 } else if (!d_in_lookup(dentry)) { 753 751 /* If it's not being looked up, it's negative */ 754 752 return -ENOENT;