* [RESEND PATCH] drm: Remove obsolete "This is gross" comment
@ 2017-09-21 21:04 Haneen Mohammed
2017-09-21 21:16 ` [Outreachy kernel] " Julia Lawall
2017-09-26 5:24 ` Daniel Vetter
0 siblings, 2 replies; 6+ messages in thread
From: Haneen Mohammed @ 2017-09-21 21:04 UTC (permalink / raw)
To: outreachy-kernel; +Cc: gregkh, dri-devel, Daniel Vetter
Remove obsolete comment which was initially added in 2008 to annotate
that idr_find() was used before idr_remove() since idr_remove() didn't
use to return feedback. The comment now is irrelevant with
commit f6cd7daecff5 ("drm: Release driver references to handle before
making it available again").
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
drivers/gpu/drm/drm_gem.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index c55f338..b9bddaa 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -282,15 +282,6 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle)
{
struct drm_gem_object *obj;
- /* This is gross. The idr system doesn't let us try a delete and
- * return an error code. It just spews if you fail at deleting.
- * So, we have to grab a lock around finding the object and then
- * doing the delete on it and dropping the refcount, or the user
- * could race us to double-decrement the refcount and cause a
- * use-after-free later. Given the frequency of our handle lookups,
- * we may want to use ida for number allocation and a hash table
- * for the pointers, anyway.
- */
spin_lock(&filp->table_lock);
/* Check if we currently have a reference on the object */
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [Outreachy kernel] [RESEND PATCH] drm: Remove obsolete "This is gross" comment 2017-09-21 21:04 [RESEND PATCH] drm: Remove obsolete "This is gross" comment Haneen Mohammed @ 2017-09-21 21:16 ` Julia Lawall 2017-09-21 21:47 ` Haneen Mohammed 2017-09-26 5:24 ` Daniel Vetter 1 sibling, 1 reply; 6+ messages in thread From: Julia Lawall @ 2017-09-21 21:16 UTC (permalink / raw) To: Haneen Mohammed; +Cc: gregkh, outreachy-kernel, dri-devel, Daniel Vetter On Thu, 21 Sep 2017, Haneen Mohammed wrote: > Remove obsolete comment which was initially added in 2008 to annotate > that idr_find() was used before idr_remove() since idr_remove() didn't > use to return feedback. The comment now is irrelevant with > commit f6cd7daecff5 ("drm: Release driver references to handle before > making it available again"). Why did you send it again? julia > > Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> > --- > drivers/gpu/drm/drm_gem.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c > index c55f338..b9bddaa 100644 > --- a/drivers/gpu/drm/drm_gem.c > +++ b/drivers/gpu/drm/drm_gem.c > @@ -282,15 +282,6 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) > { > struct drm_gem_object *obj; > > - /* This is gross. The idr system doesn't let us try a delete and > - * return an error code. It just spews if you fail at deleting. > - * So, we have to grab a lock around finding the object and then > - * doing the delete on it and dropping the refcount, or the user > - * could race us to double-decrement the refcount and cause a > - * use-after-free later. Given the frequency of our handle lookups, > - * we may want to use ida for number allocation and a hash table > - * for the pointers, anyway. > - */ > spin_lock(&filp->table_lock); > > /* Check if we currently have a reference on the object */ > -- > 2.7.4 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170921210424.GA21951%40Haneen. > For more options, visit https://groups.google.com/d/optout. > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [RESEND PATCH] drm: Remove obsolete "This is gross" comment 2017-09-21 21:16 ` [Outreachy kernel] " Julia Lawall @ 2017-09-21 21:47 ` Haneen Mohammed 2017-09-22 5:59 ` Julia Lawall 0 siblings, 1 reply; 6+ messages in thread From: Haneen Mohammed @ 2017-09-21 21:47 UTC (permalink / raw) To: Julia Lawall; +Cc: gregkh, outreachy-kernel, dri-devel, Daniel Vetter On Thu, Sep 21, 2017 at 11:16:44PM +0200, Julia Lawall wrote: > > > On Thu, 21 Sep 2017, Haneen Mohammed wrote: > > > Remove obsolete comment which was initially added in 2008 to annotate > > that idr_find() was used before idr_remove() since idr_remove() didn't > > use to return feedback. The comment now is irrelevant with > > commit f6cd7daecff5 ("drm: Release driver references to handle before > > making it available again"). > > Why did you send it again? > > julia > I forgot to include the dri-devel mailing list for the first patch. Haneen > > > > Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> > > --- > > drivers/gpu/drm/drm_gem.c | 9 --------- > > 1 file changed, 9 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c > > index c55f338..b9bddaa 100644 > > --- a/drivers/gpu/drm/drm_gem.c > > +++ b/drivers/gpu/drm/drm_gem.c > > @@ -282,15 +282,6 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) > > { > > struct drm_gem_object *obj; > > > > - /* This is gross. The idr system doesn't let us try a delete and > > - * return an error code. It just spews if you fail at deleting. > > - * So, we have to grab a lock around finding the object and then > > - * doing the delete on it and dropping the refcount, or the user > > - * could race us to double-decrement the refcount and cause a > > - * use-after-free later. Given the frequency of our handle lookups, > > - * we may want to use ida for number allocation and a hash table > > - * for the pointers, anyway. > > - */ > > spin_lock(&filp->table_lock); > > > > /* Check if we currently have a reference on the object */ > > -- > > 2.7.4 > > > > -- > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > > To post to this group, send email to outreachy-kernel@googlegroups.com. > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170921210424.GA21951%40Haneen. > > For more options, visit https://groups.google.com/d/optout. > > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [RESEND PATCH] drm: Remove obsolete "This is gross" comment 2017-09-21 21:47 ` Haneen Mohammed @ 2017-09-22 5:59 ` Julia Lawall 0 siblings, 0 replies; 6+ messages in thread From: Julia Lawall @ 2017-09-22 5:59 UTC (permalink / raw) To: Haneen Mohammed; +Cc: gregkh, outreachy-kernel, dri-devel, Daniel Vetter On Thu, 21 Sep 2017, Haneen Mohammed wrote: > On Thu, Sep 21, 2017 at 11:16:44PM +0200, Julia Lawall wrote: > > > > > > On Thu, 21 Sep 2017, Haneen Mohammed wrote: > > > > > Remove obsolete comment which was initially added in 2008 to annotate > > > that idr_find() was used before idr_remove() since idr_remove() didn't > > > use to return feedback. The comment now is irrelevant with > > > commit f6cd7daecff5 ("drm: Release driver references to handle before > > > making it available again"). > > > > Why did you send it again? > > > > julia > > > > I forgot to include the dri-devel mailing list for the first patch. OK, it should have been a v2 with a comment about what changed. Even if it is not a technical issue, it saves people wondering about what happened. julia > > Haneen > > > > > > > Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> > > > --- > > > drivers/gpu/drm/drm_gem.c | 9 --------- > > > 1 file changed, 9 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c > > > index c55f338..b9bddaa 100644 > > > --- a/drivers/gpu/drm/drm_gem.c > > > +++ b/drivers/gpu/drm/drm_gem.c > > > @@ -282,15 +282,6 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) > > > { > > > struct drm_gem_object *obj; > > > > > > - /* This is gross. The idr system doesn't let us try a delete and > > > - * return an error code. It just spews if you fail at deleting. > > > - * So, we have to grab a lock around finding the object and then > > > - * doing the delete on it and dropping the refcount, or the user > > > - * could race us to double-decrement the refcount and cause a > > > - * use-after-free later. Given the frequency of our handle lookups, > > > - * we may want to use ida for number allocation and a hash table > > > - * for the pointers, anyway. > > > - */ > > > spin_lock(&filp->table_lock); > > > > > > /* Check if we currently have a reference on the object */ > > > -- > > > 2.7.4 > > > > > > -- > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > > > To post to this group, send email to outreachy-kernel@googlegroups.com. > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170921210424.GA21951%40Haneen. > > > For more options, visit https://groups.google.com/d/optout. > > > > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170921214707.GA22325%40Haneen. > For more options, visit https://groups.google.com/d/optout. > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [RESEND PATCH] drm: Remove obsolete "This is gross" comment 2017-09-21 21:04 [RESEND PATCH] drm: Remove obsolete "This is gross" comment Haneen Mohammed 2017-09-21 21:16 ` [Outreachy kernel] " Julia Lawall @ 2017-09-26 5:24 ` Daniel Vetter 2017-09-26 20:15 ` Haneen Mohammed 1 sibling, 1 reply; 6+ messages in thread From: Daniel Vetter @ 2017-09-26 5:24 UTC (permalink / raw) To: Haneen Mohammed; +Cc: gregkh, outreachy-kernel, dri-devel, Daniel Vetter On Thu, Sep 21, 2017 at 03:04:24PM -0600, Haneen Mohammed wrote: > Remove obsolete comment which was initially added in 2008 to annotate > that idr_find() was used before idr_remove() since idr_remove() didn't > use to return feedback. The comment now is irrelevant with > commit f6cd7daecff5 ("drm: Release driver references to handle before > making it available again"). Personally I'd have added a lot more of the research story you've detailed in the private mails, just to show the work you've done. But the terse version is ok too ofc. > Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Applied to drm-misc-next, thanks. -Daniel > --- > drivers/gpu/drm/drm_gem.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c > index c55f338..b9bddaa 100644 > --- a/drivers/gpu/drm/drm_gem.c > +++ b/drivers/gpu/drm/drm_gem.c > @@ -282,15 +282,6 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) > { > struct drm_gem_object *obj; > > - /* This is gross. The idr system doesn't let us try a delete and > - * return an error code. It just spews if you fail at deleting. > - * So, we have to grab a lock around finding the object and then > - * doing the delete on it and dropping the refcount, or the user > - * could race us to double-decrement the refcount and cause a > - * use-after-free later. Given the frequency of our handle lookups, > - * we may want to use ida for number allocation and a hash table > - * for the pointers, anyway. > - */ > spin_lock(&filp->table_lock); > > /* Check if we currently have a reference on the object */ > -- > 2.7.4 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170921210424.GA21951%40Haneen. > For more options, visit https://groups.google.com/d/optout. -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [RESEND PATCH] drm: Remove obsolete "This is gross" comment 2017-09-26 5:24 ` Daniel Vetter @ 2017-09-26 20:15 ` Haneen Mohammed 0 siblings, 0 replies; 6+ messages in thread From: Haneen Mohammed @ 2017-09-26 20:15 UTC (permalink / raw) To: Daniel Vetter; +Cc: gregkh, outreachy-kernel, dri-devel, Daniel Vetter On Tue, Sep 26, 2017 at 07:24:38AM +0200, Daniel Vetter wrote: > On Thu, Sep 21, 2017 at 03:04:24PM -0600, Haneen Mohammed wrote: > > Remove obsolete comment which was initially added in 2008 to annotate > > that idr_find() was used before idr_remove() since idr_remove() didn't > > use to return feedback. The comment now is irrelevant with > > commit f6cd7daecff5 ("drm: Release driver references to handle before > > making it available again"). > > Personally I'd have added a lot more of the research story you've detailed > in the private mails, just to show the work you've done. But the terse > version is ok too ofc. > > > Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> > > Applied to drm-misc-next, thanks. > -Daniel > My bad, I was afraid to add too much details as I always read commit message should be concise that I then ended up with too little. I will try next time to add the necessary information. Thank you! Haneen > > --- > > drivers/gpu/drm/drm_gem.c | 9 --------- > > 1 file changed, 9 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c > > index c55f338..b9bddaa 100644 > > --- a/drivers/gpu/drm/drm_gem.c > > +++ b/drivers/gpu/drm/drm_gem.c > > @@ -282,15 +282,6 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) > > { > > struct drm_gem_object *obj; > > > > - /* This is gross. The idr system doesn't let us try a delete and > > - * return an error code. It just spews if you fail at deleting. > > - * So, we have to grab a lock around finding the object and then > > - * doing the delete on it and dropping the refcount, or the user > > - * could race us to double-decrement the refcount and cause a > > - * use-after-free later. Given the frequency of our handle lookups, > > - * we may want to use ida for number allocation and a hash table > > - * for the pointers, anyway. > > - */ > > spin_lock(&filp->table_lock); > > > > /* Check if we currently have a reference on the object */ > > -- > > 2.7.4 > > > > -- > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > > To post to this group, send email to outreachy-kernel@googlegroups.com. > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170921210424.GA21951%40Haneen. > > For more options, visit https://groups.google.com/d/optout. > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-09-26 20:15 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-09-21 21:04 [RESEND PATCH] drm: Remove obsolete "This is gross" comment Haneen Mohammed 2017-09-21 21:16 ` [Outreachy kernel] " Julia Lawall 2017-09-21 21:47 ` Haneen Mohammed 2017-09-22 5:59 ` Julia Lawall 2017-09-26 5:24 ` Daniel Vetter 2017-09-26 20:15 ` Haneen Mohammed
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox