#1255 closed defect (fixed)

filesystem not thread-safe

Reported by: strauman Owned by: Chris Johns
Priority: normal Milestone: 4.11
Component: fs Version: 4.10
Severity: normal Keywords:
Cc: chrisj@…, sebastian.huber@… Blocked By:
Blocking:

Description

The filesystem framework implements no locking at all.
Most routines within the framework (mknod, open, chmod, ...)
seem to be OK provided that the underlying filesystem
is thread-safe.

OTOH, some primitives (at least read()) suffer from
a race condition within the framework code (two
threads executing read() on the same file concurrently
may clobber 'iop->offset').

The IMFS has no protection against race-conditions whatsoever
and is definitely not thread safe.

Recommendation: review FS code; implement simple locking scheme
within the FS framework itself [maybe with an option for FS implementations
for disabling/overriding] so that locking doesn't have to be re-implemented
by each individual FS [but could be in case a more elaborate scheme
is desired].

Change History (5)

comment:1 Changed on May 29, 2010 at 3:57:23 AM by Chris Johns

Milestone: 4.84.11
Owner: changed from Joel Sherrill to Chris Johns
Status: newassigned, chrisj@rtems.org

comment:2 Changed on Jun 2, 2010 at 5:56:50 AM by Sebastian Huber

Cc: Sebastian Huber added

comment:3 Changed on Jun 2, 2010 at 6:09:25 AM by Chris Johns

Version: 4.84.10 (CVS)

comment:4 Changed on Jun 3, 2010 at 10:46:20 PM by Chris Johns

dependson: 1545

comment:5 Changed on May 15, 2012 at 7:13:02 AM by Sebastian Huber

Resolution: fixed
Status: assignedclosed

With this change

http://git.rtems.org/rtems/commit/?id=53da07e436df21f078de665d90442ee5c7166ab7

the thread-safety is now a per file system issue.

Note: See TracTickets for help on using tickets.