Subversion on Fat32FS
Stuart Swales (8827) 1357 posts |
Tried moving over to a new 250GB Fat32FS drive (on RISC OS 5.28, Pi 4) and encounter an odd problem with subversion 1.6.23 from PackMan (or my older 1.6.17). I can svn checkout a repository fine, svn update seems happy, but svn status reports that many of the local files are missing! Something is obviously being lost in translation twixt UnixLib and FAT32. Does anyone have a file access logger that works on RISC OS 5 to see what filing system calls are actually being made? [FileCore based filing systems working OK with svn on this system, of course.] |
Ronald (387) 195 posts |
Worked ok here on Iyonix with a usb Fat32fs stick. |
Cameron Cawley (3514) 158 posts |
I remember that ScummVM had the same issue a long time ago where occasionally you’d navigate into a directory on a Fat32FS drive using the built-in file browser and it would just show up as empty. I never figured out exactly what caused some directories to work and others to fail, but the problem went away when I rewrote the file handling in ScummVM’s RISC OS port to directly call the native APIs instead of using dirent from UnixLib, so I’d imagine that the problem is there somehow. |
Stuart Swales (8827) 1357 posts |
Have now tried that new large drive with latest Fat32FS 1.59 with no luck – still svn status is gebuggered. |
Stuart Swales (8827) 1357 posts |
Have now also done: svn checkout to dir onto Fat32FS, copy that dir to RAMFS, svn status of that dir on RAMFS is OK, so adding more weight to it being some name translation in svn status when used with Fat32FS that appears to be the issue. Maybe what’s returned by Fat32FS up to the OS interface of UnixLib dirent is not what it likes. And also: svn checkout to dir onto RAMFS (all OK), copy that dir to A.N.Other Fat32 USB device, doesn’t help. About half the files are marked as missing still. |
Grahame Parish (436) 481 posts |
Is it likely to be down to the difference between c.foo and foo.c when stored on a FAT disc? |
Stuart Swales (8827) 1357 posts |
First thought, but svn status behaviour is not consistent between various subdirs in the repo! (or indeed other repos) Some are happy with their foo.h content but not their foo.c. Or both. Or neither. Some places it doesn’t like foo.png, others are fine. Some dirs it marks the entire tree below that place as missing. I have, of course, failed to build a subversion on autobuilder to try to debug… |
Ronald (387) 195 posts |
Another angle would be to try the troublesome fat32fs device/directories on a linux svn. |
Stuart Swales (8827) 1357 posts |
Ha! RISC OS svn is truly ancient and tree-incompatible with anything you’d find on a modern system. I would assert that Fat32FS is getting the RISC OS < – > FAT32 filename translation correct as I can copy checked-out svn trees from FileCore to and then back from the Fat32FS devices fine using RISC OS, and that other svn operations are working OK regardless of which FS they are on. I think it has to be something in the Fat32FS enumeration that’s confusing svn status / UnixLib in just that one area. |
Ronald (387) 195 posts |
The svn up must have to enumerate the directories to decide what to do next, so you are right it could be a weakness in the status command. Maybe it happens over a particular size, it didn’t happen here on a small project. |
Stuart Swales (8827) 1357 posts |
Without grokking the source, I’d think that svn update will be enumerating the remote repo (in this case, over svn: protocol) and checking each remote file against the local file, where svn status has to enumerate the local directory to warn you if you’ve deleted files (marks them as missing) or have additional files that you may want to add. |
André Timmermans (100) 655 posts |
Could be the classical directory enumeration error that affect so many RISC OS programs: i.e. they stop when 0 objects are returned by the current call instead of checking that the next index is -1 (no more objects). IIRC when Fat32FS encouters a deleted entry in the FAT, it simply returns (thus with zero objects if you asked for a single one), pointing to the next entry in the FAT. |
Jeff Doggett (257) 234 posts |
This is beginning to sound like the age old problem of software authors misunderstanding the use of R4 in OS_GBPB 8,9,10,11 etc. It has been discussed at length many times. E.g Here Or the docs here “Also, do not assume anything about the value in R4 – Filer_Action assumes that it increases by one for each entry read and comes horribly unstuck.” |
André Timmermans (100) 655 posts |
Another possible issue, is that the program maybe assumes that the directory enumeration provides the objects in alphabetic order, which works only with FileCore as it is how FileCore store its directories on disk. For example, ROM building on Fat32FS fails because one of the tools used to manage resources makes such an assumption. |
Ronald (387) 195 posts |
I have built a current svn on my copy of the autobuilder. This version has no suffix swapping or filetype extensions but I can add back comma extensions easily. |
Stuart Swales (8827) 1357 posts |
Having had a look at readdir_r in SharedUnixLibrary, I suspect it might be down to it assuming that the R4 output from OS_GBPB 10 has been incremented by one for each object read – if the underlying filesystem skipped past certain internal/deleted entries in its dir structure, that may not be the case – and terminates if that is not satisfied. [Amusingly there’s a comment near the top of the source saying this is indeed assumed for hacky purposes.]
Thankfully the authors were aware of that one!
For ‘some time’, the OS has tried to determine a large enough WimpSlot when loading AIFs using the header data. |
Ronald (387) 195 posts |
It makes it sound like the filesystem is not doing its job as a wrapper of the hardware level. |
Stuart Swales (8827) 1357 posts |
Strong disagree there! It’s entirely up to the filesystem what it returns in R4 for that enumeration to locate the next object. It is most definitely NOT guaranteed to be unit monotonically increasing or interpretable by the caller. And it’s not just svn that’s using readdir… |
Ronald (387) 195 posts |
if it is a clear cut case, it will be easier than trying to provide a test case that is only on fat sometimes. |
Rick Murray (539) 13850 posts |
Three things that are very important to understand.
Anything that makes such assumptions is wrong. Yes, FilerAction, we’re all looking at you… |
Ronald (387) 195 posts |
I used the new svn to download gccsdk this morning -no problems, 24350 files and 174699406 bytes. Edit: I have rebuilt a gcc4 with the stripped down dirent.c and early tests show I haven’t broken anything (apart from suffix swapping.) Edit: I’m wondering, although the new svn is compiled static, you might need an accompaning unixlib module with the changed dirent.c to see any change? |