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

Pull ceph updates from Ilya Dryomov:

- a one-liner that leads to a startling (but also very much rational)
performance improvement in cases where an IMA policy with rules that
are based on fsmagic matching is enforced

- an encryption-related fixup that addresses generic/397 and other
fstest failures

- a couple of cleanups in CephFS

* tag 'ceph-for-6.16-rc1' of https://github.com/ceph/ceph-client:
ceph: fix variable dereferenced before check in ceph_umount_begin()
ceph: set superblock s_magic for IMA fsmagic matching
ceph: cleanup hardcoded constants of file handle size
ceph: fix possible integer overflow in ceph_zero_objects()
ceph: avoid kernel BUG for encrypted inode with unaligned file size

+25 -11
+9
fs/ceph/addr.c
··· 409 409 struct page **pages; 410 410 size_t page_off; 411 411 412 + /* 413 + * FIXME: io_iter.count needs to be corrected to aligned 414 + * length. Otherwise, iov_iter_get_pages_alloc2() operates 415 + * with the initial unaligned length value. As a result, 416 + * ceph_msg_data_cursor_init() triggers BUG_ON() in the case 417 + * if msg->sparse_read_total > msg->data_length. 418 + */ 419 + subreq->io_iter.count = len; 420 + 412 421 err = iov_iter_get_pages_alloc2(&subreq->io_iter, &pages, len, &page_off); 413 422 if (err < 0) { 414 423 doutc(cl, "%llx.%llx failed to allocate pages, %d\n",
+13 -8
fs/ceph/export.c
··· 33 33 u32 hash; 34 34 } __attribute__ ((packed)); 35 35 36 + #define BYTES_PER_U32 (sizeof(u32)) 37 + #define CEPH_FH_BASIC_SIZE \ 38 + (sizeof(struct ceph_nfs_fh) / BYTES_PER_U32) 39 + #define CEPH_FH_WITH_PARENT_SIZE \ 40 + (sizeof(struct ceph_nfs_confh) / BYTES_PER_U32) 41 + #define CEPH_FH_SNAPPED_INODE_SIZE \ 42 + (sizeof(struct ceph_nfs_snapfh) / BYTES_PER_U32) 43 + 36 44 static int ceph_encode_snapfh(struct inode *inode, u32 *rawfh, int *max_len, 37 45 struct inode *parent_inode) 38 46 { 39 47 struct ceph_client *cl = ceph_inode_to_client(inode); 40 - static const int snap_handle_length = 41 - sizeof(struct ceph_nfs_snapfh) >> 2; 48 + static const int snap_handle_length = CEPH_FH_SNAPPED_INODE_SIZE; 42 49 struct ceph_nfs_snapfh *sfh = (void *)rawfh; 43 50 u64 snapid = ceph_snap(inode); 44 51 int ret; ··· 95 88 struct inode *parent_inode) 96 89 { 97 90 struct ceph_client *cl = ceph_inode_to_client(inode); 98 - static const int handle_length = 99 - sizeof(struct ceph_nfs_fh) >> 2; 100 - static const int connected_handle_length = 101 - sizeof(struct ceph_nfs_confh) >> 2; 91 + static const int handle_length = CEPH_FH_BASIC_SIZE; 92 + static const int connected_handle_length = CEPH_FH_WITH_PARENT_SIZE; 102 93 int type; 103 94 104 95 if (ceph_snap(inode) != CEPH_NOSNAP) ··· 313 308 if (fh_type != FILEID_INO32_GEN && 314 309 fh_type != FILEID_INO32_GEN_PARENT) 315 310 return NULL; 316 - if (fh_len < sizeof(*fh) / 4) 311 + if (fh_len < sizeof(*fh) / BYTES_PER_U32) 317 312 return NULL; 318 313 319 314 doutc(fsc->client, "%llx\n", fh->ino); ··· 432 427 433 428 if (fh_type != FILEID_INO32_GEN_PARENT) 434 429 return NULL; 435 - if (fh_len < sizeof(*cfh) / 4) 430 + if (fh_len < sizeof(*cfh) / BYTES_PER_U32) 436 431 return NULL; 437 432 438 433 doutc(fsc->client, "%llx\n", cfh->parent_ino);
+1 -1
fs/ceph/file.c
··· 2616 2616 s32 stripe_unit = ci->i_layout.stripe_unit; 2617 2617 s32 stripe_count = ci->i_layout.stripe_count; 2618 2618 s32 object_size = ci->i_layout.object_size; 2619 - u64 object_set_size = object_size * stripe_count; 2619 + u64 object_set_size = (u64) object_size * stripe_count; 2620 2620 u64 nearly, t; 2621 2621 2622 2622 /* round offset up to next period boundary */
+2 -2
fs/ceph/super.c
··· 1033 1033 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); 1034 1034 1035 1035 doutc(fsc->client, "starting forced umount\n"); 1036 - if (!fsc) 1037 - return; 1036 + 1038 1037 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; 1039 1038 __ceph_umount_begin(fsc); 1040 1039 } ··· 1226 1227 s->s_time_min = 0; 1227 1228 s->s_time_max = U32_MAX; 1228 1229 s->s_flags |= SB_NODIRATIME | SB_NOATIME; 1230 + s->s_magic = CEPH_SUPER_MAGIC; 1229 1231 1230 1232 ceph_fscrypt_set_ops(s); 1231 1233