mar-file-system / marfs

MarFS provides a scalable near-POSIX file system by using one or more POSIX file systems as a scalable metadata component and one or more data stores (object, file, etc) as a scalable data component.
Other
96 stars 27 forks source link

Symlink removal through FUSE - #117

Closed thewacokid closed 8 years ago

thewacokid commented 8 years ago

I’ve abstracted out usernames/paths/filenames here.

[user@fta1 dir]$ rm -rf dir/ rm: cannot remove dir/run013': Directory not empty rm: cannot removedir/run083': Directory not empty rm: cannot remove dir/run089': Directory not empty rm: cannot removedir/run011': Directory not empty rm: cannot remove dir/run048': Directory not empty rm: cannot removedir/run071': Directory not empty rm: cannot remove dir/run033': Directory not empty rm: cannot removedir/run093': Directory not empty [user@fta1 dir]$ ls dir/ run011/ run013/ run033/ run048/ run071/ run083/ run089/ run093/ [user@fta1 dir]$ ls dir/run013/ ./ ../ file1.py@ file2.txt@ file3.obj@ file4.symlink@ [user@fta1 dir]$ ls -alh dir/run013/ total 96K drwx------ 2 user user 8.0K Mar 24 18:00 ./ drwx------ 10 user user 40K Mar 24 18:13 ../ lrwxrwxrwx 1 user group 73 Mar 24 17:59 file1.py -> /lustre/path/to/file1.py lrwxrwxrwx 1 user group 65 Mar 24 17:59 file2.txt -> /lustre/path/to/file2.txt lrwxrwxrwx 1 user group 65 Mar 24 17:59 file3.obj -> /lustre/path/to/file3.obj lrwxrwxrwx 1 user group 65 Mar 24 17:59 file4.symlink -> /lustre/path/to/file4.symlink

I had to run into the underlying MDFS to remove the symlinks.

jti-lanl commented 8 years ago

The problem was that access() follows links, and marfs_unlink() used access().

Fixed by deferring to trash_unlink(), which simply deletes links (because they don't have MarFS xattrs).