mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-03 19:55:31 +00:00
configfs updates for Linux 6.2
- fix a memory leak in configfs_create_dir (Chen Zhongjin) - remove mentions of committable items that were implemented (Bartosz Golaszewski) -----BEGIN PGP SIGNATURE----- iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAmOYq84LHGhjaEBsc3Qu ZGUACgkQD55TZVIEUYNKAhAAhJMuLaXI7UfANpltXyNoBF+8ccKz3cKQQvxJeLNw UKVWEoPWcpAyL/4VhrrfY6z10BLXi3D47kskhxGodbFSS8/UTLdkZ36h5Eko6ugZ QXfGEBOz4tEPQyjkfyZAcsextcFted+7T2eNwvWSKWc8cZVPQQigyDO0vMI27xNZ r298WXb+3W9ZyHyq30MMTvg5dIKH38SmQyjZJZuWey95y3NhZujzz5X3oPU/QNZE X5TtsgvQYgZ3QsEx9+SC6N6FB53JWI5bqlFmn+zOdqHdiRdYlD+kq2hJe4CVqIqH stPb5lbOnRYnUHzVBvnwJksF0Ikh+8SmejDRVyjHZl4i2MfqJTvEvvfwIswL3Z2G 9D1WqtjLnnC3rwEksqRd0/kgl8jGzxbmHwEJszpw8s28eGouBmoqfACPOtK1Oi6K llWFgaDsT+pXO4wMFp0EEAMtMW+r8cPGHHGfwwqnvOoh1rnGCgciclimtmdprMX2 tzwuEixUsN/OtUSy18UdLLxHNYOuPGd+hTsTmZPlkZ+qOTZ7E/QallZdsBrSd/vf lcvhRrp09qys7bu2w4i7Ff0gb9KiibHpTeaP8fdeylEyNLSH+jCFZ4vo0Vr6dtIS S58cjtkaACJ6/d42c1CnFAcG8iOgS+3yn27EbyyXnf/R67VWgAvohzepYJJidOx3 VlA= =pNzE -----END PGP SIGNATURE----- Merge tag 'configfs-6.2-2022-12-13' of git://git.infradead.org/users/hch/configfs Pull configfs updates from Christoph Hellwig: - fix a memory leak in configfs_create_dir (Chen Zhongjin) - remove mentions of committable items that were implemented (Bartosz Golaszewski) * tag 'configfs-6.2-2022-12-13' of git://git.infradead.org/users/hch/configfs: configfs: remove mentions of committable items configfs: fix possible memory leak in configfs_create_dir()
This commit is contained in:
commit
6a24711d5c
@ -289,7 +289,6 @@ config_item_type::
|
|||||||
const char *name);
|
const char *name);
|
||||||
struct config_group *(*make_group)(struct config_group *group,
|
struct config_group *(*make_group)(struct config_group *group,
|
||||||
const char *name);
|
const char *name);
|
||||||
int (*commit_item)(struct config_item *item);
|
|
||||||
void (*disconnect_notify)(struct config_group *group,
|
void (*disconnect_notify)(struct config_group *group,
|
||||||
struct config_item *item);
|
struct config_item *item);
|
||||||
void (*drop_item)(struct config_group *group,
|
void (*drop_item)(struct config_group *group,
|
||||||
@ -486,50 +485,3 @@ up. Here, the heartbeat code calls configfs_depend_item(). If it
|
|||||||
succeeds, then heartbeat knows the region is safe to give to ocfs2.
|
succeeds, then heartbeat knows the region is safe to give to ocfs2.
|
||||||
If it fails, it was being torn down anyway, and heartbeat can gracefully
|
If it fails, it was being torn down anyway, and heartbeat can gracefully
|
||||||
pass up an error.
|
pass up an error.
|
||||||
|
|
||||||
Committable Items
|
|
||||||
=================
|
|
||||||
|
|
||||||
Note:
|
|
||||||
Committable items are currently unimplemented.
|
|
||||||
|
|
||||||
Some config_items cannot have a valid initial state. That is, no
|
|
||||||
default values can be specified for the item's attributes such that the
|
|
||||||
item can do its work. Userspace must configure one or more attributes,
|
|
||||||
after which the subsystem can start whatever entity this item
|
|
||||||
represents.
|
|
||||||
|
|
||||||
Consider the FakeNBD device from above. Without a target address *and*
|
|
||||||
a target device, the subsystem has no idea what block device to import.
|
|
||||||
The simple example assumes that the subsystem merely waits until all the
|
|
||||||
appropriate attributes are configured, and then connects. This will,
|
|
||||||
indeed, work, but now every attribute store must check if the attributes
|
|
||||||
are initialized. Every attribute store must fire off the connection if
|
|
||||||
that condition is met.
|
|
||||||
|
|
||||||
Far better would be an explicit action notifying the subsystem that the
|
|
||||||
config_item is ready to go. More importantly, an explicit action allows
|
|
||||||
the subsystem to provide feedback as to whether the attributes are
|
|
||||||
initialized in a way that makes sense. configfs provides this as
|
|
||||||
committable items.
|
|
||||||
|
|
||||||
configfs still uses only normal filesystem operations. An item is
|
|
||||||
committed via rename(2). The item is moved from a directory where it
|
|
||||||
can be modified to a directory where it cannot.
|
|
||||||
|
|
||||||
Any group that provides the ct_group_ops->commit_item() method has
|
|
||||||
committable items. When this group appears in configfs, mkdir(2) will
|
|
||||||
not work directly in the group. Instead, the group will have two
|
|
||||||
subdirectories: "live" and "pending". The "live" directory does not
|
|
||||||
support mkdir(2) or rmdir(2) either. It only allows rename(2). The
|
|
||||||
"pending" directory does allow mkdir(2) and rmdir(2). An item is
|
|
||||||
created in the "pending" directory. Its attributes can be modified at
|
|
||||||
will. Userspace commits the item by renaming it into the "live"
|
|
||||||
directory. At this point, the subsystem receives the ->commit_item()
|
|
||||||
callback. If all required attributes are filled to satisfaction, the
|
|
||||||
method returns zero and the item is moved to the "live" directory.
|
|
||||||
|
|
||||||
As rmdir(2) does not work in the "live" directory, an item must be
|
|
||||||
shutdown, or "uncommitted". Again, this is done via rename(2), this
|
|
||||||
time from the "live" directory back to the "pending" one. The subsystem
|
|
||||||
is notified by the ct_group_ops->uncommit_object() method.
|
|
||||||
|
@ -316,6 +316,7 @@ static int configfs_create_dir(struct config_item *item, struct dentry *dentry,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_remove:
|
out_remove:
|
||||||
|
configfs_put(dentry->d_fsdata);
|
||||||
configfs_remove_dirent(dentry);
|
configfs_remove_dirent(dentry);
|
||||||
return PTR_ERR(inode);
|
return PTR_ERR(inode);
|
||||||
}
|
}
|
||||||
@ -382,6 +383,7 @@ int configfs_create_link(struct configfs_dirent *target, struct dentry *parent,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_remove:
|
out_remove:
|
||||||
|
configfs_put(dentry->d_fsdata);
|
||||||
configfs_remove_dirent(dentry);
|
configfs_remove_dirent(dentry);
|
||||||
return PTR_ERR(inode);
|
return PTR_ERR(inode);
|
||||||
}
|
}
|
||||||
|
@ -204,8 +204,6 @@ static struct configfs_bin_attribute _pfx##attr_##_name = { \
|
|||||||
* group children. default_groups may coexist alongsize make_group() or
|
* group children. default_groups may coexist alongsize make_group() or
|
||||||
* make_item(), but if the group wishes to have only default_groups
|
* make_item(), but if the group wishes to have only default_groups
|
||||||
* children (disallowing mkdir(2)), it need not provide either function.
|
* children (disallowing mkdir(2)), it need not provide either function.
|
||||||
* If the group has commit(), it supports pending and committed (active)
|
|
||||||
* items.
|
|
||||||
*/
|
*/
|
||||||
struct configfs_item_operations {
|
struct configfs_item_operations {
|
||||||
void (*release)(struct config_item *);
|
void (*release)(struct config_item *);
|
||||||
@ -216,7 +214,6 @@ struct configfs_item_operations {
|
|||||||
struct configfs_group_operations {
|
struct configfs_group_operations {
|
||||||
struct config_item *(*make_item)(struct config_group *group, const char *name);
|
struct config_item *(*make_item)(struct config_group *group, const char *name);
|
||||||
struct config_group *(*make_group)(struct config_group *group, const char *name);
|
struct config_group *(*make_group)(struct config_group *group, const char *name);
|
||||||
int (*commit_item)(struct config_item *item);
|
|
||||||
void (*disconnect_notify)(struct config_group *group, struct config_item *item);
|
void (*disconnect_notify)(struct config_group *group, struct config_item *item);
|
||||||
void (*drop_item)(struct config_group *group, struct config_item *item);
|
void (*drop_item)(struct config_group *group, struct config_item *item);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user