User: Password:
|
|
Subscribe / Log in / New account

Empty symlinks and full POSIX compliance

Empty symlinks and full POSIX compliance

Posted May 23, 2013 12:41 UTC (Thu) by etienne (guest, #25256)
Parent article: Empty symlinks and full POSIX compliance

Would empty symlink be a documented way to remove a file in a unionfs?
I.e. the read-only backing store contains a file named "dummy", the read/write overlay receive a "delete dummy" so the overlay remove "dummy" by creating an empty "dummy" symlink.


(Log in to post comments)

Empty symlinks and full POSIX compliance

Posted May 28, 2013 20:18 UTC (Tue) by ms-tg (subscriber, #89231) [Link]

That's very interesting -- if that's not how it's done, how is it done?

Empty symlinks and full POSIX compliance

Posted May 29, 2013 9:04 UTC (Wed) by etienne (guest, #25256) [Link]

> if that's not how it's done

Did not read the source code, but extracted from:
http://lwn.net/Articles/325126/
-------
If a file is deleted which exists at the bottom layer, a so-called
whiteout file with the same name is created at the top layer. Users
never get to see this file; it is not included in readdir results, and
trying to open it fails with errno == ENOENT. If a file with the same
name is later created, this file replaces the whiteout.
-------
readdir() could forget to list empty symlinks, but anyway if the file is listed in readdir() trying to open it would look like the file did exist but has now disappeared - i.e. has been removed since readdir() was initialised.

Empty symlinks and full POSIX compliance

Posted May 28, 2013 20:32 UTC (Tue) by mathstuf (subscriber, #69389) [Link]

Why not just make a self-referential symlink? Same result, but avoids the corner case.


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds