[PATCH] ext4: replace ktype default_attrs with default_groups

2019-05-08 Thread Kimberly Brown
The kobj_type default_attrs field is being replaced by the default_groups field. Replace the default_attrs field in ext4_sb_ktype and ext4_feat_ktype with default_groups. Use the ATTRIBUTE_GROUPS macro to create ext4_groups and ext4_feat_groups. Signed-off-by: Kimberly Brown --- This patch

Re: [PATCH v2 0/8] kobject: Add default group support to kobj_type and replace subsystem uses

2019-04-27 Thread Kimberly Brown
On Thu, Apr 25, 2019 at 10:12:53PM +0200, Greg Kroah-Hartman wrote: > On Mon, Apr 01, 2019 at 10:51:10PM -0400, Kimberly Brown wrote: > > This patchset adds support for default attribute groups to kobj_type. > > Also, the uses of kobj_type's default_attrs field are replaced with >

[PATCH v2 8/8] livepatch: Replace klp_ktype_patch's default_attrs with groups

2019-04-01 Thread Kimberly Brown
that the sysfs files for the attributes in the default groups were created. Signed-off-by: Kimberly Brown --- kernel/livepatch/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index eb0ee10a1981..34a8338657d2 100644 --- a/kernel

[PATCH v2 5/8] irqdesc: Replace irq_kobj_type's default_attrs field with groups

2019-04-01 Thread Kimberly Brown
groups were created. Signed-off-by: Kimberly Brown --- kernel/irq/irqdesc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 13539e12cd80..bbec57bda666 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -275,11 +275,12

[PATCH v2 7/8] cpufreq: schedutil: Replace default_attrs field with groups

2019-04-01 Thread Kimberly Brown
as tested by setting the scaling governor to schedutil and verifying that the sysfs files for the attributes in the default groups were created. Signed-off-by: Kimberly Brown --- kernel/sched/cpufreq_schedutil.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/sched/cpufreq_

[PATCH v2 2/8] samples/kobject: Replace foo_ktype's default_attrs field with groups

2019-04-01 Thread Kimberly Brown
for the attributes in the default group were created. Signed-off-by: Kimberly Brown --- samples/kobject/kset-example.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c index 401328fd687d..c8010f126808 100644

[PATCH v2 1/8] kobject: Add support for default attribute groups to kobj_type

2019-04-01 Thread Kimberly Brown
uses of kobj_type’s attribute list will be converted to attribute groups. When that is complete, kobj_type’s attribute list, “default_attrs”, will be removed. Signed-off-by: Kimberly Brown --- include/linux/kobject.h | 3 ++- lib/kobject.c | 14 ++ 2 files changed, 16

Re: [PATCH v3 3/3] Drivers: hv: vmbus: Fix race condition with new ring_buffer_info mutex

2019-03-27 Thread Kimberly Brown
On Thu, Mar 21, 2019 at 04:04:20PM +, Michael Kelley wrote: > From: Kimberly Brown Sent: Wednesday, March 20, 2019 > 8:48 PM > > > > > Adding more locks will solve the problem but it seems like overkill. > > > > > Why not either use a re

Re: [PATCH] kobject: Add support for default attribute groups to kobj_type

2019-03-23 Thread Kimberly Brown
On Sat, Mar 23, 2019 at 07:07:37AM +0100, Greg Kroah-Hartman wrote: > On Fri, Mar 22, 2019 at 04:14:40PM -0400, Kimberly Brown wrote: > > kobj_type currently uses a list of individual attributes to store > > default attributes. Attribute groups are more flexible than a list of

[PATCH] kobject: Add support for default attribute groups to kobj_type

2019-03-22 Thread Kimberly Brown
uses of kobj_type’s attribute list will be converted to attribute groups. When that is complete, kobj_type’s attribute list, “default_attrs”, will be removed. Signed-off-by: Kimberly Brown --- include/linux/kobject.h | 3 ++- lib/kobject.c | 14 ++ 2 files changed, 16

Re: [PATCH v3 3/3] Drivers: hv: vmbus: Fix race condition with new ring_buffer_info mutex

2019-03-20 Thread Kimberly Brown
On Wed, Mar 20, 2019 at 01:06:19PM -0700, Stephen Hemminger wrote: > On Sat, 16 Mar 2019 21:49:28 -0400 > Kimberly Brown wrote: > > > On Thu, Mar 14, 2019 at 03:45:33PM -0700, Stephen Hemminger wrote: > > > On Thu, 14 Mar 2019 13:05:15 -0700 > > > "Kimber

[PATCH v6] Drivers: hv: vmbus: Expose monitor data only when monitor pages are used

2019-03-18 Thread Kimberly Brown
k function to be applied to the channel-level attributes. Call "sysfs_create_group()" in "vmbus_add_channel_kobj()" to create the channel's sysfs files. Add a new function, “vmbus_remove_channel_attr_group()”, and call it in "free_channel()" to remove the channel's sysfs fil

Re: [PATCH v3 3/3] Drivers: hv: vmbus: Fix race condition with new ring_buffer_info mutex

2019-03-16 Thread Kimberly Brown
On Thu, Mar 14, 2019 at 03:45:33PM -0700, Stephen Hemminger wrote: > On Thu, 14 Mar 2019 13:05:15 -0700 > "Kimberly Brown" wrote: > > > Fix a race condition that can result in a ring buffer pointer being set > > to null while a "_show" function is reading

[PATCH v3 2/3] Drivers: hv: vmbus: Set ring_info field to 0 and remove memset

2019-03-14 Thread Kimberly Brown
Set "ring_info->priv_read_index" to 0. Now, all of ring_info's fields are explicitly set in this function. The memset() call is no longer necessary, so remove it. Signed-off-by: Kimberly Brown --- drivers/hv/ring_buffer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-

[PATCH v3 0/3] Drivers: hv: vmbus: Fix a race condition in "_show" functions

2019-03-14 Thread Kimberly Brown
tion. However, using this mutex could result in a deadlock, so a new approach is proposed in this patchset. - Patch 1 is new and consists of refactoring an if statement. - Patch 2 introduces a new mutex lock in the “vmbus_channel” struct, which is used to eliminate the race condition. Kimb

[PATCH v3 3/3] Drivers: hv: vmbus: Fix race condition with new ring_buffer_info mutex

2019-03-14 Thread Kimberly Brown
so that the locks can be acquired/released in these functions. Acquire/release the locks in hv_ringbuffer_get_debuginfo(). Remove the "const" qualifier from the "hv_ring_buffer_info" parameter so that the locks can be acquired/released in this function. Signed-off-by: Kimberly Brown --- drivers/hv

[PATCH v3 1/3] Drivers: hv: vmbus: Refactor chan->state if statement

2019-03-14 Thread Kimberly Brown
g buffer. The ring buffer pointer does not need to be checked before calling the other "_show" functions, and moving the ring buffer pointer "if statement" to the "_show" functions that access a ring buffer makes the purpose of the "if statement" clear. Signe

Re: [PATCH v5] Drivers: hv: vmbus: Expose monitor data only when monitor pages are used

2019-03-11 Thread Kimberly Brown
On Sat, Mar 09, 2019 at 08:21:35AM +0100, Greg KH wrote: > On Fri, Mar 08, 2019 at 05:46:11PM -0500, Kimberly Brown wrote: > > static struct kobj_type vmbus_chan_ktype = { > > .sysfs_ops = _chan_sysfs_ops, > > .release = vmbus_chan_release, > > - .defau

[PATCH v5] Drivers: hv: vmbus: Expose monitor data only when monitor pages are used

2019-03-08 Thread Kimberly Brown
roup have been created. Add the “vmbus_remove_channel_attr_group()” function, which calls "sysfs_remove_group()" on “vmbus_chan_group” if the attributes were created. Signed-off-by: Kimberly Brown --- Changes in v5: - Added the “bool sysfs_group_ready” field to vmbus_channel.

Re: [PATCH v4] Drivers: hv: vmbus: Expose monitor data only when monitor pages are used

2019-03-03 Thread Kimberly Brown
On Sat, Mar 02, 2019 at 06:39:30PM +, Michael Kelley wrote: > From: Kimberly Brown Sent: Friday, March 1, 2019 > 11:18 AM > > > > +/* > > + * Channel-level attribute_group callback function. Returns the permission > > for > > + * each attr

Re: [PATCH v4] Drivers: hv: vmbus: Expose monitor data only when monitor pages are used

2019-03-03 Thread Kimberly Brown
On Sun, Mar 03, 2019 at 09:05:43AM +0100, Greg KH wrote: > On Fri, Mar 01, 2019 at 02:18:24PM -0500, Kimberly Brown wrote: > > +/* > > + * Channel-level attribute_group callback function. Returns the permission > > for > > + * each attribute, and returns 0 if

[PATCH v4] Drivers: hv: vmbus: Expose monitor data only when monitor pages are used

2019-03-01 Thread Kimberly Brown
e()" callback function to be applied to the channel-level attributes. Call "sysfs_create_group()" to create the channel sysyfs files. Signed-off-by: Kimberly Brown --- Changes in v4: - Added “is_visible()” callback functions for the device-level and channel-level attribute groups. -

Re: [PATCH v2 2/2] Drivers: hv: vmbus: Add a channel ring buffer mutex lock

2019-02-25 Thread Kimberly Brown
On Sun, Feb 24, 2019 at 04:53:03PM +, Michael Kelley wrote: > From: Kimberly Brown Sent: Thursday, February 21, 2019 > 7:47 PM > > > > The "_show" functions that access channel ring buffer data are > > vulnerable to a race condition that can result

[PATCH v3] Drivers: hv: vmbus: Expose monitor data when channel uses monitor pages

2019-02-25 Thread Kimberly Brown
vmbus_add_channel_kobj(). Signed-off-by: Kimberly Brown --- Changes in v3: The monitor "_show" functions no longer return an error when a channel does not use the monitor page mechanism. Instead, the monitor page sysfs files are created only when a channel uses the monitor page mechanism. This

Re: [GIT PULL v3] Hyper-V commits for 5.0-rc

2019-02-24 Thread Kimberly Brown
you to fetch changes up to b2946cd86f3c1b5b1262c0ec06068110c2328fe6: > > > > > > > > MAINTAINERS: Change mailing list for Hyper-V CORE AND DRIVERS > > > > (2019-02-22 21:46:37 -0500) > > > > > > > > - > > &

Re: [GIT PULL v3] Hyper-V commits for 5.0-rc

2019-02-23 Thread Kimberly Brown
> (2019-02-22 21:46:37 -0500) > > > > > > - -------- > > > Two fixes: > > > > > > 1. A fix for a race condition reading sysfs entries while a device is > > > being added, by Kimberly Brown.

[PATCH v2 2/2] Drivers: hv: vmbus: Add a channel ring buffer mutex lock

2019-02-21 Thread Kimberly Brown
quot; in hv_ringbuffer_get_debuginfo(). Pass the channel pointer to hv_ringbuffer_get_debuginfo() so that "ring_buffer_mutex" can be accessed in this function. Signed-off-by: Kimberly Brown --- drivers/hv/channel.c | 5 ++ drivers/hv/channel_mgmt.c | 1 + drivers/hv/ring_buffer.c | 11

[PATCH v2 1/2] Drivers: hv: vmbus: Refactor chan->state if statement

2019-02-21 Thread Kimberly Brown
g buffer. The ring buffer pointer does not need to be checked before calling the other "_show" functions, and moving the ring buffer pointer "if statement" to the "_show" functions that access a ring buffer makes the purpose of the "if statement" clear

[PATCH v2 0/2] Fix a race condition vulnerability in "_show" functions

2019-02-21 Thread Kimberly Brown
uld result in a deadlock, so a new approach is needed. - Patch 1 is new and consists of a code refactor. - Patch 2 introduces a new mutex lock in the “vmbus_channel” struct, and the new mutex is used to eliminate the race condition. Kimberly Brown (2): Drivers: hv: vmbus: Refactor chan->state

[PATCH v2 2/2] Drivers: hv: vmbus: Return -EINVAL if monitor_allocated not set

2019-02-18 Thread Kimberly Brown
onitor_allocated" is set before accessing the monitor id or the monitor page data. If "channel->offermsg.monitor_allocated" is not set, return -EINVAL. Signed-off-by: Kimberly Brown --- Documentation/ABI/stable/sysfs-bus-vmbus | 15 -- drivers/hv/vmbus_drv.c

[PATCH v2 1/2] Drivers: hv: vmbus: Change server monitor_pages index to 0

2019-02-18 Thread Kimberly Brown
ion, the server_monitor_latency_show() and server_monitor_conn_id_show() functions use monitor_pages index '0'. Signed-off-by: Kimberly Brown Acked-by: Stephen Hemminger --- drivers/hv/vmbus_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_dr

[PATCH v2 0/2] Drivers: hv: vmbus: Fix sysfs functions that display monitor id and page data

2019-02-18 Thread Kimberly Brown
nger. - Updated the sysfs documentation to describe the new return value. Kimberly Brown (2): Drivers: hv: vmbus: Change server monitor_pages index to 0 Drivers: hv: vmbus: Return -EINVAL if monitor_allocated not set Documentation/ABI/stable/sysfs-bus-vmbus | 15 +++-- drive

Re: [PATCH] Drivers: hv: vmbus: Add mutex lock to channel show functions

2019-02-14 Thread Kimberly Brown
On Thu, Feb 14, 2019 at 08:54:31PM -0500, Sasha Levin wrote: > On Sat, Feb 02, 2019 at 03:07:35PM -0500, Kimberly Brown wrote: > > On Fri, Feb 01, 2019 at 06:24:24PM +, Dexuan Cui wrote: > > > > From: Kimberly Brown > > > > Sent: Thursday, January 31, 2

Re: [PATCH 2/2] Drivers: hv: vmbus: Display nothing in sysfs if monitor_allocated not set

2019-02-13 Thread Kimberly Brown
On Mon, Feb 11, 2019 at 10:02:47AM -0800, Stephen Hemminger wrote: > On Mon, 11 Feb 2019 02:01:18 -0500 > Kimberly Brown wrote: > > > On Fri, Feb 08, 2019 at 02:32:09PM -0800, Stephen Hemminger wrote: > > > On Fri, 8 Feb 2019 05:01:12 -0500 > > > Kimberly Brown

Re: [PATCH 2/2] Drivers: hv: vmbus: Display nothing in sysfs if monitor_allocated not set

2019-02-11 Thread Kimberly Brown
On Fri, Feb 08, 2019 at 02:32:09PM -0800, Stephen Hemminger wrote: > On Fri, 8 Feb 2019 05:01:12 -0500 > Kimberly Brown wrote: > > You are right, the current behavior is broken. > It would be good to add a description of under what conditions > monitor is not used. Is this some

[PATCH 2/2] Drivers: hv: vmbus: Display nothing in sysfs if monitor_allocated not set

2019-02-08 Thread Kimberly Brown
ocated to a channel. In the affected "_show" functions, verify that "channel->offermsg.monitor_allocated" is set before accessing the monitor id or the monitor_page data. If "channel->offermsg.monitor_allocated" is not set, display nothing. Signed-off-by: Kimber

[PATCH 1/2] Drivers: hv: vmbus: Change server monitor_pages index to 0

2019-02-08 Thread Kimberly Brown
ion, the server_monitor_latency_show() and server_monitor_conn_id_show() functions use monitor_pages index '0'. Signed-off-by: Kimberly Brown --- drivers/hv/vmbus_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 403fee015

[PATCH 0/2] Drivers: hv: vmbus: Fix sysfs functions that display monitor id and page data

2019-02-08 Thread Kimberly Brown
, display nothing in the channel's monitor id and monitor page data sysfs files. The data that is currently shown in sysfs is incorrect. Kimberly Brown (2): Drivers: hv: vmbus: Change server monitor_pages index to 0 Drivers: hv: vmbus: Display nothing in sysfs if monitor_allocated not set

[PATCH v4] Drivers: hv: vmbus: Expose counters for interrupts and full conditions

2019-02-03 Thread Kimberly Brown
created and observing the counter values. The values seemed to increase by a reasonable amount when the Hyper-v related drivers were in use. Signed-off-by: Kimberly Brown --- Changes in v4: - In the commit message, added a paragraph describing why the full condition counters are incremented

Re: [PATCH] Drivers: hv: vmbus: Add mutex lock to channel show functions

2019-02-02 Thread Kimberly Brown
On Fri, Feb 01, 2019 at 06:24:24PM +, Dexuan Cui wrote: > > From: Kimberly Brown > > Sent: Thursday, January 31, 2019 9:47 AM > > ... > > 2) Prevent a deadlock that can occur between the proposed mutex_lock() > > call in the vmbus_chan_attr_show() function and th

Re: [PATCH] Drivers: hv: vmbus: Add mutex lock to channel show functions

2019-01-31 Thread Kimberly Brown
On Thu, Jan 31, 2019 at 04:45:35PM +, Michael Kelley wrote: > From: Sasha Levin Sent: Thursday, January 31, 2019 7:20 AM > > > > I've queued this one for hyper-fixes, thanks all! > > > > Actually, please hold off on queuing this one. In a conversation I had > yesterday with Kim, they had

Re: [PATCH] Drivers: hv: vmbus: Add mutex lock to channel show functions

2019-01-28 Thread Kimberly Brown
On Tue, Jan 22, 2019 at 06:40:30PM +, Dexuan Cui wrote: > > From: Kimberly Brown > > Sent: Monday, January 21, 2019 10:43 PM > > > > @@ -1421,7 +1422,10 @@ static ssize_t vmbus_chan_attr_show(struct > > > > kobject *kobj, > > > >

Re: [PATCH] Drivers: hv: vmbus: Add mutex lock to channel show functions

2019-01-21 Thread Kimberly Brown
On Tue, Jan 22, 2019 at 03:46:48AM +, Dexuan Cui wrote: > > From: Kimberly Brown > > Sent: Monday, January 21, 2019 6:08 PM > > Subject: [PATCH] Drivers: hv: vmbus: Add mutex lock to channel show > > functions > > > > The channel level "_show&quo

[PATCH] Drivers: hv: vmbus: Add mutex lock to channel show functions

2019-01-21 Thread Kimberly Brown
The channel level "_show" functions are vulnerable to race conditions. Add a mutex lock and unlock around the call to the channel level "_show" functions in vmbus_chan_attr_show(). This problem was discussed here: https://lkml.org/lkml/2018/10/18/830 Signed-off-by: Kimberly

Re: [PATCH v3] Drivers: hv: vmbus: Expose counters for interrupts and full conditions

2019-01-21 Thread Kimberly Brown
On Thu, Jan 17, 2019 at 09:11:03AM -0800, Stephen Hemminger wrote: > > > > +static ssize_t channel_intr_in_full_show(const struct vmbus_channel > > *channel, > > +char *buf) > > +{ > > + return sprintf(buf, "%llu\n", channel->intr_in_full); > > +} > > >

[PATCH v3] Drivers: hv: vmbus: Expose counters for interrupts and full conditions

2019-01-16 Thread Kimberly Brown
drivers were in use. Signed-off-by: Kimberly Brown --- Changes in v3: - Used the outbound ring buffer spinlock to protect the the full condition counters in set_channel_pending_send_size() - Corrected the KernelVersion values for the new entries in Documentation/ABI/stable/sysfs-bus-vmbus

[PATCH v2] Drivers: hv: vmbus: Expose counters for interrupts and full conditions

2019-01-04 Thread Kimberly Brown
drivers were in use. Signed-off-by: Kimberly Brown --- Changes in v2: - Added mailing lists to the cc list - Removed the host to guest interrupt counters proposed in v1 because they were not accurate - Added full condition counters for the channel's outbound ring buffer Documentation