mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge tag 'ceph-for-6.12-rc2' of https://github.com/ceph/ceph-client
Pull ceph fixes from Ilya Dryomov: "A fix from Patrick for a variety of CephFS lockup scenarios caused by a regression in cap handling which sneaked in through the netfs helper library in 5.18 (marked for stable) and an unrelated one-line cleanup" * tag 'ceph-for-6.12-rc2' of https://github.com/ceph/ceph-client: ceph: fix cap ref leak via netfs init_request ceph: use struct_size() helper in __ceph_pool_perm_get()
This commit is contained in:
@@ -489,8 +489,11 @@ static int ceph_init_request(struct netfs_io_request *rreq, struct file *file)
|
||||
rreq->io_streams[0].sreq_max_len = fsc->mount_options->rsize;
|
||||
|
||||
out:
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
if (got)
|
||||
ceph_put_cap_refs(ceph_inode(inode), got);
|
||||
kfree(priv);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2145,7 +2148,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
|
||||
}
|
||||
|
||||
pool_ns_len = pool_ns ? pool_ns->len : 0;
|
||||
perm = kmalloc(sizeof(*perm) + pool_ns_len + 1, GFP_NOFS);
|
||||
perm = kmalloc(struct_size(perm, pool_ns, pool_ns_len + 1), GFP_NOFS);
|
||||
if (!perm) {
|
||||
err = -ENOMEM;
|
||||
goto out_unlock;
|
||||
|
||||
Reference in New Issue
Block a user