orangefs: two fixes
Fix the size of a memory allocation in orangefs_bufmap_alloc() Christophe JAILLET use default_groups in kobj_type Greg KH -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEIGSFVdO6eop9nER2z0QOqevODb4FAmHlgOQACgkQz0QOqevO Db75Ng/+Lruql+eMqjMrmwRf8Rm1tErTjyll1RgynB608xd3A8mzRxk0U9+EQDCJ U1fa0N1AJatSDh0X8PLke0lMR1YxGFNs+gmIswz4b0B0tpSuw+oJhUTrYSaeE5ud boD+EwCIv7G3bTUqT8eC3sRFGZycIfQUMKS7Ml76OKxQXSd+9BaP4e7s87/kQItI oRxBx/AzndLjhQWfPhCGVqYMzetto/pSAQaUfspH/pIAaDYPmuTCBvNf9crMjQ1k TI7Pf0CMTGFdki0p5MkhK5co90X28aI+QHaycCtWMvwKxcASU1mKaJ5IqEzholkY Q89cEyMeb8RkQjeOC8L1jG1GvkrBJNzdm30NVo4m7uQBp1ExXdvUnQRQ+FnJ7nEP SAX5trxIrQuNKq1/hLqxngIQ3/duLxtnaFd9ZwmixTvQUgtxLTQL9Bued1WmcNTR Z3VePxyIgqKKsdzzx0uBAd501/T77aB5TwSiVaZQNEDc44oZhr6rricrYP2tjnq4 3XLsAzb5djPUj3kEhbc4HKPatl67r7LsFumOMjZGnnj2nEsvQLH9o53snWlyfBYS 40CrulcEiIjD5dgt/xAojhPT20CyqCYH9mJyZ5NfvRlcR30vNT9/okeoFnUyKTB4 JBhHT/bu89CGD5F1M6G6wHGXNv/szxPDzW08/dUJA+BrZrHOYJQ= =OM/4 -----END PGP SIGNATURE----- Merge tag 'for-linus-5.17-ofs-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux Pull orangefs fixes from Mike Marshall: "Two fixes: - Fix the size of a memory allocation in orangefs_bufmap_alloc() (Christophe JAILLET) - Use default_groups in kobj_type (Greg KH)" * tag 'for-linus-5.17-ofs-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() orangefs: use default_groups in kobj_type
This commit is contained in:
commit
f0033681f0
|
@ -176,7 +176,7 @@ orangefs_bufmap_free(struct orangefs_bufmap *bufmap)
|
|||
{
|
||||
kfree(bufmap->page_array);
|
||||
kfree(bufmap->desc_array);
|
||||
kfree(bufmap->buffer_index_array);
|
||||
bitmap_free(bufmap->buffer_index_array);
|
||||
kfree(bufmap);
|
||||
}
|
||||
|
||||
|
@ -226,8 +226,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc)
|
|||
bufmap->desc_size = user_desc->size;
|
||||
bufmap->desc_shift = ilog2(bufmap->desc_size);
|
||||
|
||||
bufmap->buffer_index_array =
|
||||
kzalloc(DIV_ROUND_UP(bufmap->desc_count, BITS_PER_LONG), GFP_KERNEL);
|
||||
bufmap->buffer_index_array = bitmap_zalloc(bufmap->desc_count, GFP_KERNEL);
|
||||
if (!bufmap->buffer_index_array)
|
||||
goto out_free_bufmap;
|
||||
|
||||
|
@ -250,7 +249,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc)
|
|||
out_free_desc_array:
|
||||
kfree(bufmap->desc_array);
|
||||
out_free_index_array:
|
||||
kfree(bufmap->buffer_index_array);
|
||||
bitmap_free(bufmap->buffer_index_array);
|
||||
out_free_bufmap:
|
||||
kfree(bufmap);
|
||||
out:
|
||||
|
|
|
@ -894,10 +894,11 @@ static struct attribute *orangefs_default_attrs[] = {
|
|||
&perf_time_interval_secs_attribute.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(orangefs_default);
|
||||
|
||||
static struct kobj_type orangefs_ktype = {
|
||||
.sysfs_ops = &orangefs_sysfs_ops,
|
||||
.default_attrs = orangefs_default_attrs,
|
||||
.default_groups = orangefs_default_groups,
|
||||
};
|
||||
|
||||
static struct orangefs_attribute acache_hard_limit_attribute =
|
||||
|
@ -931,10 +932,11 @@ static struct attribute *acache_orangefs_default_attrs[] = {
|
|||
&acache_timeout_msecs_attribute.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(acache_orangefs_default);
|
||||
|
||||
static struct kobj_type acache_orangefs_ktype = {
|
||||
.sysfs_ops = &orangefs_sysfs_ops,
|
||||
.default_attrs = acache_orangefs_default_attrs,
|
||||
.default_groups = acache_orangefs_default_groups,
|
||||
};
|
||||
|
||||
static struct orangefs_attribute capcache_hard_limit_attribute =
|
||||
|
@ -968,10 +970,11 @@ static struct attribute *capcache_orangefs_default_attrs[] = {
|
|||
&capcache_timeout_secs_attribute.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(capcache_orangefs_default);
|
||||
|
||||
static struct kobj_type capcache_orangefs_ktype = {
|
||||
.sysfs_ops = &orangefs_sysfs_ops,
|
||||
.default_attrs = capcache_orangefs_default_attrs,
|
||||
.default_groups = capcache_orangefs_default_groups,
|
||||
};
|
||||
|
||||
static struct orangefs_attribute ccache_hard_limit_attribute =
|
||||
|
@ -1005,10 +1008,11 @@ static struct attribute *ccache_orangefs_default_attrs[] = {
|
|||
&ccache_timeout_secs_attribute.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(ccache_orangefs_default);
|
||||
|
||||
static struct kobj_type ccache_orangefs_ktype = {
|
||||
.sysfs_ops = &orangefs_sysfs_ops,
|
||||
.default_attrs = ccache_orangefs_default_attrs,
|
||||
.default_groups = ccache_orangefs_default_groups,
|
||||
};
|
||||
|
||||
static struct orangefs_attribute ncache_hard_limit_attribute =
|
||||
|
@ -1042,10 +1046,11 @@ static struct attribute *ncache_orangefs_default_attrs[] = {
|
|||
&ncache_timeout_msecs_attribute.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(ncache_orangefs_default);
|
||||
|
||||
static struct kobj_type ncache_orangefs_ktype = {
|
||||
.sysfs_ops = &orangefs_sysfs_ops,
|
||||
.default_attrs = ncache_orangefs_default_attrs,
|
||||
.default_groups = ncache_orangefs_default_groups,
|
||||
};
|
||||
|
||||
static struct orangefs_attribute pc_acache_attribute =
|
||||
|
@ -1072,10 +1077,11 @@ static struct attribute *pc_orangefs_default_attrs[] = {
|
|||
&pc_ncache_attribute.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(pc_orangefs_default);
|
||||
|
||||
static struct kobj_type pc_orangefs_ktype = {
|
||||
.sysfs_ops = &orangefs_sysfs_ops,
|
||||
.default_attrs = pc_orangefs_default_attrs,
|
||||
.default_groups = pc_orangefs_default_groups,
|
||||
};
|
||||
|
||||
static struct orangefs_attribute stats_reads_attribute =
|
||||
|
@ -1095,10 +1101,11 @@ static struct attribute *stats_orangefs_default_attrs[] = {
|
|||
&stats_writes_attribute.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(stats_orangefs_default);
|
||||
|
||||
static struct kobj_type stats_orangefs_ktype = {
|
||||
.sysfs_ops = &orangefs_sysfs_ops,
|
||||
.default_attrs = stats_orangefs_default_attrs,
|
||||
.default_groups = stats_orangefs_default_groups,
|
||||
};
|
||||
|
||||
static struct kobject *orangefs_obj;
|
||||
|
|
Loading…
Reference in New Issue