Introduce DM_UEVENT_GENERATED_FLAG in dm ioctl return and let user space
program know whether a uevent was generated or not. This helps the ioctl
caller to determine proper actions that should be taken while awaiting the
uevent.
Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
---
+/*
+ * Indicates whether a uevent was generated.
+ */
+#define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */
+
#endif /* _LINUX_DM_IOCTL_H */
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
03-05-2010, 06:32 PM
Alasdair G Kergon
dm_ioctl: Introduce DM_UEVENT_GENERATED_FLAG
On Mon, Mar 01, 2010 at 09:27:17AM +0100, Peter Rajnoha wrote:
> diff -purN linux-2.6.33-rc8.orig/drivers/md/dm-ioctl.c linux-2.6.33-rc8/drivers/md/dm-ioctl.c
> @@ -736,10 +738,10 @@ static int dev_remove(struct dm_ioctl *p
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
03-05-2010, 06:38 PM
Alasdair G Kergon
dm_ioctl: Introduce DM_UEVENT_GENERATED_FLAG
On Mon, Mar 01, 2010 at 09:27:17AM +0100, Peter Rajnoha wrote:
> + if (!dm_kobject_uevent(hc->md, KOBJ_CHANGE, cookie))
> + *flags |= DM_UEVENT_GENERATED_FLAG;
If userspace set this flag before the call, where is it cleared?
It needs to have a defined state on *every* call.
I'll add this to the top of validate_params.
Alasdair
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
03-08-2010, 06:07 AM
Peter Rajnoha
dm_ioctl: Introduce DM_UEVENT_GENERATED_FLAG
On 03/05/2010 08:32 PM, Alasdair G Kergon wrote:
> On Mon, Mar 01, 2010 at 09:27:17AM +0100, Peter Rajnoha wrote:
>> diff -purN linux-2.6.33-rc8.orig/drivers/md/dm-ioctl.c linux-2.6.33-rc8/drivers/md/dm-ioctl.c
>
>> @@ -736,10 +738,10 @@ static int dev_remove(struct dm_ioctl *p
>
>> dm_put(md);
>> - param->data_size = 0;
>> return 0;
>
> Why is that line removed?
That's because of the copy_to_user in the outer ctl_ioctl fn
so it copies back the result (with the new flag). We had nothing
in return before...
Peter
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
03-08-2010, 06:10 AM
Peter Rajnoha
dm_ioctl: Introduce DM_UEVENT_GENERATED_FLAG
On 03/05/2010 08:38 PM, Alasdair G Kergon wrote:
> On Mon, Mar 01, 2010 at 09:27:17AM +0100, Peter Rajnoha wrote:
>> + if (!dm_kobject_uevent(hc->md, KOBJ_CHANGE, cookie))
>> + *flags |= DM_UEVENT_GENERATED_FLAG;
>
> If userspace set this flag before the call, where is it cleared?
> It needs to have a defined state on *every* call.
> I'll add this to the top of validate_params.
Yes, you're right, we shouldn't rely on userspace to do this.
Indeed, it needs to be cleared directly. Thanks!
Peter
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel