[Devel] [PATCH RH9 03/10] fs: add kobj into fs_uevent

Kirill Tkhai ktkhai at virtuozzo.com
Tue Jan 25 15:22:59 MSK 2022


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 fs/ext4/super.c    |    3 ++-
 include/linux/fs.h |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index e40c511a9d26..efafb86937e3 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -498,7 +498,7 @@ static void ext4_send_uevent_work(struct work_struct *w)
 	}
 	if (ret)
 		goto out;
-	ret = kobject_uevent_env(&(EXT4_SB(sb)->s_kobj), kaction, env->envp);
+	ret = kobject_uevent_env(e->kobject, kaction, env->envp);
 out:
 	kfree(env);
 	kfree(e);
@@ -529,6 +529,7 @@ void ext4_send_uevent(struct super_block *sb, enum fs_event_type action)
 	/* Do not forget to flush fs_events_wq before you kill sb */
 	e->sb = sb;
 	e->action = action;
+	e->kobject = &EXT4_SB(sb)->s_kobj;
 	INIT_WORK(&e->work, ext4_send_uevent_work);
 	queue_work(fs_events_wq, &e->work);
 }
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 226093049c17..6e76379d6035 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3173,6 +3173,7 @@ enum fs_event_type {
 struct fs_uevent {
 	struct super_block *sb;
 	enum fs_event_type action;
+	struct kobject *kobject;
 	struct work_struct work;
 };
 




More information about the Devel mailing list