[RTEMS Project] #4536: acess JFFS2 sb->s_root

RTEMS trac trac at rtems.org
Wed Oct 27 14:47:06 UTC 2021


#4536: acess JFFS2 sb->s_root
----------------------------+--------------------
  Reporter:  chenjin_zhong  |      Owner:  (none)
      Type:  defect         |     Status:  new
  Priority:  normal         |  Milestone:  5.1
 Component:  admin          |    Version:  5
  Severity:  normal         |   Keywords:
Blocked By:                 |   Blocking:
----------------------------+--------------------
 Hi, I have found when access global structure without mutex or spinlock
 about JFFS2 may cause  indetermination. The peice of source code in
 RTEMS5.1 are listed as follows:
     fs-rtems.c:
   1)  // Add to the icache
         for (cached_inode = sb->s_root; cached_inode != NULL;
              cached_inode = cached_inode->i_cache_next) {
                 if (cached_inode->i_cache_next == NULL) {
                         cached_inode->i_cache_next = inode;     // Current
 last in cache points to newcomer
                         inode->i_cache_prev = cached_inode;     //
 Newcomer points back to last
                         break;
                 }
         }


 2)       // Check for this inode in the cache
         for (inode = sb->s_root; inode != NULL; inode =
 inode->i_cache_next) {
                 if (inode->i_ino == ino) {
                         inode->i_count++;
                         break;
                 }
         }

  when multi-tasks or threads access sb->s_root  simultaneously, The
 behavior is unknown.

--
Ticket URL: <http://devel.rtems.org/ticket/4536>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list