This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1000539] New: fatfs chdir("..") broken


http://bugs.ecos.sourceware.org/show_bug.cgi?id=1000539

           Summary: fatfs chdir("..") broken
           Product: eCos
           Version: CVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: normal
         Component: Filesystem support
        AssignedTo: jifl@ecoscentric.com
        ReportedBy: andrew.lunn@ascom.ch
         QAContact: ecos-bugs@ecos.sourceware.org
             Class: ---


While testing the recent contribution for readdir d_type, i found a
bug in fatfs. Enabling assert brings this to light when running the
fatfs1 test case. Without asserts it dereferences a null pointer,
which on synth in gdb causes a segmentation fault.

The problem sequence goes like:

mkdir("noonoo");
chdir("noonoo");
chdir("..");
rmdir("noonoo");

The problem is with the chdir(".."), which later causes the rmdir to
explode.

The fatfs does not correctly implement the concept of .. . Each
directory does have . and .. directories inodes, but .. does not seem
to link back correctly to the parent directory inode. Doing a
chdir("..") takes you into the .. inode, when it should take you up a
level to the parent. chdir("..") also increments the reference count
on the ".." inode, not the inode of the parent directory. This is why
the rmdir("noonoo") fails, the inode for "noonoo/.." reference count
is not zero.

This problem was not spotted before because until the last patch we
actually leaked the . and .. inodes when a directory was removed.  Now
we try to clean them up get run into this problem.


-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]