#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 Jan 6, 2008 at 4:58:30 AM.
fix for the reported bug

Download all attachments as: .zip

Change History (4)

Changed on Jan 6, 2008 at 4:58:30 AM by strauman

Attachment: bdbuf.c-disk_release.diff added

fix for the reported bug

comment:1 Changed on Aug 6, 2008 at 3:39:15 AM by Chris Johns

Cc: Chris Johns added
Resolution: fixed
Status: newclosed

Fixed in the new bdbuf code.

comment:2 Changed on Nov 23, 2014 at 7:33:55 AM by Chris Johns

Description: modified (diff)

comment:3 Changed on Oct 10, 2017 at 6:49:19 AM by Sebastian Huber

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