RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1316024 - Allow clearing of statistics region's aux_data field
Summary: Allow clearing of statistics region's aux_data field
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel
Version: 7.2
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Bryn M. Reeves
QA Contact: Storage QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-09 09:42 UTC by Bryn M. Reeves
Modified: 2021-09-06 14:33 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-17 17:03:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
dm-stats: add @stats_clear_aux message (1.53 KB, patch)
2016-03-09 17:17 UTC, Bryn M. Reeves
no flags Details | Diff

Description Bryn M. Reeves 2016-03-09 09:42:58 UTC
Description of problem:
The dm-stats facility provides a means to store a string as auxilliary data to a region that is set either when the region is created or via the @stats_set_aux method:

@stats_create - /1 dmstats this_is_aux_data
@stats_set_aux 1 this_is_aux_data_too

The userspace dmstats support will use this to track groups of regions defined by the user by storing a string description of the group members and other properties in the aux_data field.

Since users can create and delete groups at any time there needs to be a mechanism to remove a previously stored value or to set the field to the empty string.

This is not currently possible as the empty string is treated as whitespace leading to EINVAL from the message ioctl (as a workaround it is possible to set the field to a dummy character like '-' but this is not ideal).

Adding a new @stats_clear_aux message seems like the simplest change and should be a simple patch.

Version-Release number of selected component (if applicable):
kernel-3.10.0-*

How reproducible:
100%

Steps to Reproduce:
1. Create a region with aux_data
2. Attempt to re-set it to empty aux_data with @stats_set_aux


Actual results:
EINVAL with the empty string; at least one character must be set.

Expected results:
Ability to remove previously stored aux_data.

Additional info:
WIP groups support: https://git.fedorahosted.org/cgit/lvm2.git/log/?h=dev-bmr-dmstats-groups

Comment 1 Alasdair Kergon 2016-03-09 14:24:06 UTC
I've no objections to @stats_clear_aux

Comment 2 Bryn M. Reeves 2016-03-09 17:17:08 UTC
Created attachment 1134589 [details]
dm-stats: add @stats_clear_aux message

Untested patch to add a @stats_clear_aux message. This was chosen over modifying the @stats_set_aux message to avoid the need to add optional arguments (as @stats_create uses for the precise_timestamps and histogram extensions).

Comment 3 Bryn M. Reeves 2016-03-17 17:03:29 UTC
While working on the patch for this I realised that the current dm-stats code in the kernel actually now assigns a default hard-coded aux_data (and program_id) of "-" - I'd mistakenly thought that these values were added only during output if these fields had a NULL pointer in the dm_stats structure.

Re-setting the field to "-" using @stats_set_aux does work (although it looks a bit weird) so this change is not necessary for the current groups support.

Closing NOTABUG.

Comment 4 Alasdair Kergon 2016-03-17 18:03:24 UTC
Is this documented?  If not, then Documentation/device-mapper/statistics.txt may need a patch.


Note You need to log in before you can comment on or make changes to this bug.