Can't write to tarfs-extracted file until re-open

Nick Withers nick.withers at anu.edu.au
Fri Feb 20 03:59:38 UTC 2015


Hello all,

I'm doing something that may be a little dodgy to begin with, but used
to work (pre the IMFS changes of the 2015-02-12, I believe; I'll figure
it out if anyone would like, though. I'm currently at RTEMS git
c34f94f72df4e88e1c4ea7d7f97f14a9ec6296ef).

I have a directory with a file [1] tar'ed up and bin2c'ed into my
application. When I first open and try to write to it, it fails with
ENOSYS (calling into rtems_filesystem_default_write() through
IMFS_linfile_handlers).

If I then close it, re-open and retry the write, it succeeds (this time
hitting memfile_write through IMFS_memfile_handlers). A small test case
is attached (build with e.g., "gmake RTEMS_CPU_ARCH=powerpc BSP=psim").


First things first... Is opening a file created with tarfs (from tar
data in ROM) and writing to it kosher?

I *think* it is, and that it's supposed to be migrated from an IMFS
linear node into an IMFS memory node when written to [or opened for
writing with existing data?] (see e.g., IMFS_linfile_open())...?

Assuming I'm not being dodgy, I s'pose I'm hoping someone with RTEMS
file-system internals / IMFS knowledge's gonna jump up and say "Ah, I
know what that'll be!", as I haven't been able to figure it out so far
and I'd appreciate any help :-)


Cheers all - have a good weekend!


[1] The reason being that I want to symlink to the file from another
location within the same tar'ed directories (the web server root) and
bin2c doesn't seem like a symlink to a non-existent file
-- 
Nick Withers

Embedded Systems Programmer
Department of Nuclear Physics, Research School of Physics and Engineering
The Australian National University (CRICOS: 00120C)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtems-write-tarfs-file.tar.bz2
Type: application/x-bzip-compressed-tar
Size: 2585 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20150220/8a94ba39/attachment.bin>


More information about the users mailing list