Notice: We have migrated to GitLab launching 2024-05-01 see here:

#1272 closed defect (fixed)

[libblock, bdbuf] disk released early

Reported by: strauman Owned by: Joel Sherrill
Priority: normal Milestone: 4.9
Component: lib/block Version: 4.7
Severity: normal Keywords:
Cc: chrisj@…, victor.vengerov@… Blocked By:

Description (last modified by Chris Johns)

A long time ago, Eugeny Mints reported

But you remaind me about bug in rtems_bdbuf_get - there
rtems_disk_release(dd) call rigth befor DISABLE_PREEMPTION
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)

Attachments (1)

bdbuf.c-disk_release.diff (1.6 KB) - added by strauman on 01/06/08 at 04:58:30.
fix for the reported bug

Download all attachments as: .zip

Change History (4)

Changed on 01/06/08 at 04:58:30 by strauman

Attachment: bdbuf.c-disk_release.diff added

fix for the reported bug

comment:1 Changed on 08/06/08 at 03:39:15 by Chris Johns

Cc: Chris Johns added
Resolution: fixed
Status: newclosed

Fixed in the new bdbuf code.

comment:2 Changed on 11/23/14 at 07:33:55 by Chris Johns

Description: modified (diff)

comment:3 Changed on 10/10/17 at 06:49:19 by Sebastian Huber

Component: scorelib/block
Note: See TracTickets for help on using tickets.