All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] Rename CAP_EPOLLWAKEUP to CAL_BLOCK_SUSPEND
@ 2012-07-17  4:37 Michael Kerrisk
  2012-07-17 13:46 ` Serge E. Hallyn
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Kerrisk @ 2012-07-17  4:37 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, LKML, Magnus Damm, markgross, Matthew Garrett,
	Greg KH, Arve Hjønnevåg, John Stultz, Brian Swetland,
	Neil Brown, Alan Stern, Dmitry Torokhov, Srivatsa S. Bhat,
	Michael Kerrisk (gmail),
	mtk

Rafael,

As discussed in
http://thread.gmane.org/gmane.linux.kernel/1249726/focus=1288990,
the capability introduced in 4d7e30d98939a0340022ccd49325a3d70f7e0238
to govern EPOLLWAKEUP seems misnamed: this capability is about governing
the ability to suspend the system, not using a particular API flag
(EPOLLWAKEUP). We should make the name of the capability more general
to encourage reuse in related cases. (Whether or not this capability
should also be used to govern the use of /sys/power/wake_lock is a
question that needs to be separately resolved.)

This patch renames the capability to CAP_BLOCK_SUSPEND. In order to ensure
that the old capability name doesn't make it out into the wild, could you
please apply and push up the tree to ensure that it is incorporated
for the 3.5 release.

Thanks,

Michael

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>

---
 fs/eventpoll.c             |    2 +-
 include/linux/capability.h |    6 +++---
 include/linux/eventpoll.h  |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 74598f6..1c8b556 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1710,7 +1710,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
 		goto error_tgt_fput;
 
 	/* Check if EPOLLWAKEUP is allowed */
-	if ((epds.events & EPOLLWAKEUP) && !capable(CAP_EPOLLWAKEUP))
+	if ((epds.events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
 		epds.events &= ~EPOLLWAKEUP;
 
 	/*
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 68d56ef..d10b7ed 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -360,11 +360,11 @@ struct cpu_vfs_cap_data {
 
 #define CAP_WAKE_ALARM            35
 
-/* Allow preventing system suspends while epoll events are pending */
+/* Allow preventing system suspends */
 
-#define CAP_EPOLLWAKEUP      36
+#define CAP_BLOCK_SUSPEND    36
 
-#define CAP_LAST_CAP         CAP_EPOLLWAKEUP
+#define CAP_LAST_CAP         CAP_BLOCK_SUSPEND
 
 #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
 
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index 6f8be32..f4bb378 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -34,7 +34,7 @@
  * re-allowed until epoll_wait is called again after consuming the wakeup
  * event(s).
  *
- * Requires CAP_EPOLLWAKEUP
+ * Requires CAP_BLOCK_SUSPEND
  */
 #define EPOLLWAKEUP (1 << 29)
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [patch] Rename CAP_EPOLLWAKEUP to CAL_BLOCK_SUSPEND
  2012-07-17  4:37 [patch] Rename CAP_EPOLLWAKEUP to CAL_BLOCK_SUSPEND Michael Kerrisk
@ 2012-07-17 13:46 ` Serge E. Hallyn
  2012-07-17 13:54   ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 5+ messages in thread
From: Serge E. Hallyn @ 2012-07-17 13:46 UTC (permalink / raw)
  To: Michael Kerrisk
  Cc: Rafael J. Wysocki, Linux PM list, LKML, Magnus Damm, markgross,
	Matthew Garrett, Greg KH, Arve Hjønnevåg, John Stultz,
	Brian Swetland, Neil Brown, Alan Stern, Dmitry Torokhov,
	Srivatsa S. Bhat, mtk

Quoting Michael Kerrisk (mtk.manpages@gmail.com):
> Rafael,
> 
> As discussed in
> http://thread.gmane.org/gmane.linux.kernel/1249726/focus=1288990,
> the capability introduced in 4d7e30d98939a0340022ccd49325a3d70f7e0238
> to govern EPOLLWAKEUP seems misnamed: this capability is about governing
> the ability to suspend the system, not using a particular API flag
> (EPOLLWAKEUP). We should make the name of the capability more general
> to encourage reuse in related cases. (Whether or not this capability
> should also be used to govern the use of /sys/power/wake_lock is a
> question that needs to be separately resolved.)
> 
> This patch renames the capability to CAP_BLOCK_SUSPEND. In order to ensure
> that the old capability name doesn't make it out into the wild, could you
> please apply and push up the tree to ensure that it is incorporated
> for the 3.5 release.
> 
> Thanks,
> 
> Michael
> 
> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>

I definately like that name better, thanks.  Don't know if renaming it
without an alias could cause trouble for some bleeding edge userspaces?
Would it be worth keeping the 

#define CAP_EPOLLWAKEUP      36

line?  If this is deemed early enough I do prefer not to complicate with
a duplicate name.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>

> 
> ---
>  fs/eventpoll.c             |    2 +-
>  include/linux/capability.h |    6 +++---
>  include/linux/eventpoll.h  |    2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/eventpoll.c b/fs/eventpoll.c
> index 74598f6..1c8b556 100644
> --- a/fs/eventpoll.c
> +++ b/fs/eventpoll.c
> @@ -1710,7 +1710,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
>  		goto error_tgt_fput;
>  
>  	/* Check if EPOLLWAKEUP is allowed */
> -	if ((epds.events & EPOLLWAKEUP) && !capable(CAP_EPOLLWAKEUP))
> +	if ((epds.events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
>  		epds.events &= ~EPOLLWAKEUP;
>  
>  	/*
> diff --git a/include/linux/capability.h b/include/linux/capability.h
> index 68d56ef..d10b7ed 100644
> --- a/include/linux/capability.h
> +++ b/include/linux/capability.h
> @@ -360,11 +360,11 @@ struct cpu_vfs_cap_data {
>  
>  #define CAP_WAKE_ALARM            35
>  
> -/* Allow preventing system suspends while epoll events are pending */
> +/* Allow preventing system suspends */
>  
> -#define CAP_EPOLLWAKEUP      36
> +#define CAP_BLOCK_SUSPEND    36
>  
> -#define CAP_LAST_CAP         CAP_EPOLLWAKEUP
> +#define CAP_LAST_CAP         CAP_BLOCK_SUSPEND
>  
>  #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
>  
> diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
> index 6f8be32..f4bb378 100644
> --- a/include/linux/eventpoll.h
> +++ b/include/linux/eventpoll.h
> @@ -34,7 +34,7 @@
>   * re-allowed until epoll_wait is called again after consuming the wakeup
>   * event(s).
>   *
> - * Requires CAP_EPOLLWAKEUP
> + * Requires CAP_BLOCK_SUSPEND
>   */
>  #define EPOLLWAKEUP (1 << 29)
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] Rename CAP_EPOLLWAKEUP to CAL_BLOCK_SUSPEND
  2012-07-17 13:46 ` Serge E. Hallyn
@ 2012-07-17 13:54   ` Michael Kerrisk (man-pages)
  2012-07-17 13:59     ` Serge E. Hallyn
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2012-07-17 13:54 UTC (permalink / raw)
  To: Serge E. Hallyn
  Cc: Rafael J. Wysocki, Linux PM list, LKML, Magnus Damm, markgross,
	Matthew Garrett, Greg KH, Arve Hjønnevåg, John Stultz,
	Brian Swetland, Neil Brown, Alan Stern, Dmitry Torokhov,
	Srivatsa S. Bhat, mtk, Michael Kerrisk

On Tue, Jul 17, 2012 at 3:46 PM, Serge E. Hallyn <serge@hallyn.com> wrote:
> Quoting Michael Kerrisk (mtk.manpages@gmail.com):
>> Rafael,
>>
>> As discussed in
>> http://thread.gmane.org/gmane.linux.kernel/1249726/focus=1288990,
>> the capability introduced in 4d7e30d98939a0340022ccd49325a3d70f7e0238
>> to govern EPOLLWAKEUP seems misnamed: this capability is about governing
>> the ability to suspend the system, not using a particular API flag
>> (EPOLLWAKEUP). We should make the name of the capability more general
>> to encourage reuse in related cases. (Whether or not this capability
>> should also be used to govern the use of /sys/power/wake_lock is a
>> question that needs to be separately resolved.)
>>
>> This patch renames the capability to CAP_BLOCK_SUSPEND. In order to ensure
>> that the old capability name doesn't make it out into the wild, could you
>> please apply and push up the tree to ensure that it is incorporated
>> for the 3.5 release.
>>
>> Thanks,
>>
>> Michael
>>
>> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
>
> I definately like that name better, thanks.  Don't know if renaming it
> without an alias could cause trouble for some bleeding edge userspaces?
> Would it be worth keeping the
>
> #define CAP_EPOLLWAKEUP      36
>
> line?  If this is deemed early enough I do prefer not to complicate with
> a duplicate name.

Maybe I'm too ignorant. Are there userspaces that bleed with the -rc
series? I'd have thought this renaming would be a fairly safe change
at this point.

> Acked-by: Serge Hallyn <serge.hallyn@canonical.com>

Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] Rename CAP_EPOLLWAKEUP to CAL_BLOCK_SUSPEND
  2012-07-17 13:54   ` Michael Kerrisk (man-pages)
@ 2012-07-17 13:59     ` Serge E. Hallyn
  2012-07-17 19:05       ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Serge E. Hallyn @ 2012-07-17 13:59 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Serge E. Hallyn, Rafael J. Wysocki, Linux PM list, LKML,
	Magnus Damm, markgross, Matthew Garrett, Greg KH,
	Arve Hjønnevåg, John Stultz, Brian Swetland,
	Neil Brown, Alan Stern, Dmitry Torokhov, Srivatsa S. Bhat, mtk

Quoting Michael Kerrisk (man-pages) (mtk.manpages@gmail.com):
> On Tue, Jul 17, 2012 at 3:46 PM, Serge E. Hallyn <serge@hallyn.com> wrote:
> > Quoting Michael Kerrisk (mtk.manpages@gmail.com):
> >> Rafael,
> >>
> >> As discussed in
> >> http://thread.gmane.org/gmane.linux.kernel/1249726/focus=1288990,
> >> the capability introduced in 4d7e30d98939a0340022ccd49325a3d70f7e0238
> >> to govern EPOLLWAKEUP seems misnamed: this capability is about governing
> >> the ability to suspend the system, not using a particular API flag
> >> (EPOLLWAKEUP). We should make the name of the capability more general
> >> to encourage reuse in related cases. (Whether or not this capability
> >> should also be used to govern the use of /sys/power/wake_lock is a
> >> question that needs to be separately resolved.)
> >>
> >> This patch renames the capability to CAP_BLOCK_SUSPEND. In order to ensure
> >> that the old capability name doesn't make it out into the wild, could you
> >> please apply and push up the tree to ensure that it is incorporated
> >> for the 3.5 release.
> >>
> >> Thanks,
> >>
> >> Michael
> >>
> >> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
> >
> > I definately like that name better, thanks.  Don't know if renaming it
> > without an alias could cause trouble for some bleeding edge userspaces?
> > Would it be worth keeping the
> >
> > #define CAP_EPOLLWAKEUP      36
> >
> > line?  If this is deemed early enough I do prefer not to complicate with
> > a duplicate name.
> 
> Maybe I'm too ignorant. Are there userspaces that bleed with the -rc
> series? I'd have thought this renaming would be a fairly safe change
> at this point.

I'm sure there are, but I'm not sure what we've promised them.

Like I say if at all possible I do prefer not to keep CAP_EPOLLWAKEUP.

-serge

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] Rename CAP_EPOLLWAKEUP to CAL_BLOCK_SUSPEND
  2012-07-17 13:59     ` Serge E. Hallyn
@ 2012-07-17 19:05       ` Rafael J. Wysocki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-07-17 19:05 UTC (permalink / raw)
  To: Serge E. Hallyn
  Cc: Michael Kerrisk (man-pages),
	Linux PM list, LKML, Magnus Damm, markgross, Matthew Garrett,
	Greg KH, Arve Hjønnevåg, John Stultz, Brian Swetland,
	Neil Brown, Alan Stern, Dmitry Torokhov, Srivatsa S. Bhat, mtk

On Tuesday, July 17, 2012, Serge E. Hallyn wrote:
> Quoting Michael Kerrisk (man-pages) (mtk.manpages@gmail.com):
> > On Tue, Jul 17, 2012 at 3:46 PM, Serge E. Hallyn <serge@hallyn.com> wrote:
> > > Quoting Michael Kerrisk (mtk.manpages@gmail.com):
> > >> Rafael,
> > >>
> > >> As discussed in
> > >> http://thread.gmane.org/gmane.linux.kernel/1249726/focus=1288990,
> > >> the capability introduced in 4d7e30d98939a0340022ccd49325a3d70f7e0238
> > >> to govern EPOLLWAKEUP seems misnamed: this capability is about governing
> > >> the ability to suspend the system, not using a particular API flag
> > >> (EPOLLWAKEUP). We should make the name of the capability more general
> > >> to encourage reuse in related cases. (Whether or not this capability
> > >> should also be used to govern the use of /sys/power/wake_lock is a
> > >> question that needs to be separately resolved.)
> > >>
> > >> This patch renames the capability to CAP_BLOCK_SUSPEND. In order to ensure
> > >> that the old capability name doesn't make it out into the wild, could you
> > >> please apply and push up the tree to ensure that it is incorporated
> > >> for the 3.5 release.
> > >>
> > >> Thanks,
> > >>
> > >> Michael
> > >>
> > >> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
> > >
> > > I definately like that name better, thanks.  Don't know if renaming it
> > > without an alias could cause trouble for some bleeding edge userspaces?
> > > Would it be worth keeping the
> > >
> > > #define CAP_EPOLLWAKEUP      36
> > >
> > > line?  If this is deemed early enough I do prefer not to complicate with
> > > a duplicate name.
> > 
> > Maybe I'm too ignorant. Are there userspaces that bleed with the -rc
> > series? I'd have thought this renaming would be a fairly safe change
> > at this point.

I'm not so sure of that, but then I think it will be less painful
to do it now rather than later.

> I'm sure there are, but I'm not sure what we've promised them.

I can't recall making any promises to anyone in that respect, but then
people have had quite enough time to get used to the existing name already.

> Like I say if at all possible I do prefer not to keep CAP_EPOLLWAKEUP.

I will push the Michael's patch to Linus for v3.5, if it's not too late,
but I'm not pleased by the timing of this, to put it lightly.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-07-17 18:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17  4:37 [patch] Rename CAP_EPOLLWAKEUP to CAL_BLOCK_SUSPEND Michael Kerrisk
2012-07-17 13:46 ` Serge E. Hallyn
2012-07-17 13:54   ` Michael Kerrisk (man-pages)
2012-07-17 13:59     ` Serge E. Hallyn
2012-07-17 19:05       ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.