Opened 4 days ago

Last modified 4 days ago

#19123 new enhancement

return EEXIST instead of EROFS for directories in ~/config

Reported by: nephele Owned by: nobody
Priority: normal Milestone:
Component: System/Kernel Version: R1/Development
Keywords: Cc: waddlesplash
Blocked By: Blocking:
Platform: All

Description

Currently when trying to create a directory in ~/config that already exists EROFS is returned as error, it would be nice to return EEXIST instead.

While both errors are correct (and posix does not seem to specify which we should use) This leads to some ported programms having to be patched, as they will try to use XDG_CACHE_HOME for example, which we set as ~/config/cache currently.

When the programm tries to mkdir ~/config/cache most ported apps seem to treats status code 0 and EEXIST as sucess, and all else as failures.

The correct way for such ported apps in this instance would be to accept EROFS, and then do stat or something else to confirm the direcory exists.

I propose we change the behaviour here (of packagefs) to eliminate this edgecase.

Change History (1)

comment:1 by waddlesplash, 4 days ago

Component: File Systems/packagefsSystem/Kernel
Owner: changed from bonefish to nobody

This is more due to the kernel, actually. packagefs doesn't even provide a create_dir hook, so the kernel returns EROFS for it.

What do Linux and the BSDs do here if you mount a partition read-only but union-mount another filesystem inside it? That's the equivalent case for packagefs.

Note: See TracTickets for help on using tickets.