[RTEMS Project] #1272: [libblock, bdbuf] disk released early
RTEMS trac
trac at rtems.org
Sun Nov 23 07:33:56 UTC 2014
#1272: [libblock, bdbuf] disk released early
----------------------+----------------------------
Reporter: strauman | Owner: joel.sherrill
Type: defect | Status: closed
Priority: normal | Milestone: 4.9
Component: cpukit | Version: 4.7
Severity: normal | Resolution: fixed
Keywords: |
----------------------+----------------------------
Description changed by chrisj:
Old description:
> A long time ago, Eugeny Mints reported
> (http://www.rtems.org/ml/rtems-users/2002/october/msg00041.html)
>
> >But you remaind me about bug in rtems_bdbuf_get - there
> >rtems_disk_release(dd) call rigth befor DISABLE_PREEMPTION
> >is
> >wrong because pdd pointer which is used later in ioctl may
> >be null if between rtems_disk_release(dd)
> >call and DISABLE_PREEMPTION some high priority task removed
> >both devices (pointed by dd and pdd). This bug may be fixed
> >by simply moving rtems_disk_release(dd) call below
> >find_or_assign_buffer(pdd, block, &bd_buf) call.
> >The same was in rtems_bdbuf_read but I fixed it in this
> >routine but forgot about rtems_bdbuf_get :(
>
> The attached patch fixes this issue.
>
> Also, releasing the disk was moved after re-enabling task preemption
> (for consistency; other routines in bdbuf.c also re-enable task
> preemption prior to releasing the disk)
New description:
A long time ago, Eugeny Mints reported
(http://lists.rtems.org/pipermail/users/2002-October/005740.html)
>But you remaind me about bug in rtems_bdbuf_get - there
>rtems_disk_release(dd) call rigth befor DISABLE_PREEMPTION
>is
>wrong because pdd pointer which is used later in ioctl may
>be null if between rtems_disk_release(dd)
>call and DISABLE_PREEMPTION some high priority task removed
>both devices (pointed by dd and pdd). This bug may be fixed
>by simply moving rtems_disk_release(dd) call below
>find_or_assign_buffer(pdd, block, &bd_buf) call.
>The same was in rtems_bdbuf_read but I fixed it in this
>routine but forgot about rtems_bdbuf_get :(
The attached patch fixes this issue.
Also, releasing the disk was moved after re-enabling task preemption
(for consistency; other routines in bdbuf.c also re-enable task
preemption prior to releasing the disk)
--
--
Ticket URL: <http://devel.rtems.org/ticket/1272#comment:2>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list