fallthru: ext2 fallthru support
Quoted 11 lines · Miklos Szeredi
Quoted 9 lines · Valerie Aurora
Quoted 2 lines
- hard links to make sure a separate inode is not necessary for each whiteout/fallthrough entry
The problem with hard links is that you run into hard link limits. I don't think we can do hard links for whiteouts and fallthrus. Each whiteout or fallthru will cost an inode if we implement them as extended attributes. This cost has to be balanced against the cost of implementing them as dentries, which is mainly code complexity in individual file systems.
Not knowing the details, I'd suggest to implement a generic function to create an attributed inode and let the fs override it to create an unlinked-file-dentry instead.
Benefit: All fs supporting extended attributes will be able to support whiteout. If the fs has other means of supporting whiteout, they may fake the attribute.
Possible problems:
- Having two ways of reporting a whiteout? Or can it be reported using a (static) fake inode?
- How do you un-whiteout while (not) having an overlaying fs?
Quoted 6 lines
get_unlinked_inode()is a great idea. But I feel that individual inodes for each fallthrough is excessive. It'll make the firstreaddir()really really expensive and wastes a lot of disk and memory for no good reason.Not sure how to fix the hard link limits problem though...
Do a hardlink if you can create a hard link, otherwise use a fresh inode and use that for the next hardlink(s).
Quoted 11 lines · Miklos Szeredi
Quoted 9 lines · Valerie Aurora
Quoted 2 lines
- hard links to make sure a separate inode is not necessary for each whiteout/fallthrough entry
The problem with hard links is that you run into hard link limits. I don't think we can do hard links for whiteouts and fallthrus. Each whiteout or fallthru will cost an inode if we implement them as extended attributes. This cost has to be balanced against the cost of implementing them as dentries, which is mainly code complexity in individual file systems.
Not knowing the details, I'd suggest to implement a generic function to create an attributed inode and let the fs override it to create an unlinked-file-dentry instead.
Benefit: All fs supporting extended attributes will be able to support whiteout. If the fs has other means of supporting whiteout, they may fake the attribute.
Possible problems:
- Having two ways of reporting a whiteout? Or can it be reported using a (static) fake inode?
- How do you un-whiteout while (not) having an overlaying fs?
Quoted 6 lines
get_unlinked_inode()is a great idea. But I feel that individual inodes for each fallthrough is excessive. It'll make the firstreaddir()really really expensive and wastes a lot of disk and memory for no good reason.Not sure how to fix the hard link limits problem though...
Do a hardlink if you can create a hard link, otherwise use a fresh inode and use that for the next hardlink(s).
Bodo Eggert:
Quoted 2 lines
Do a hardlink if you can create a hard link, otherwise use a fresh inode and use that for the next hardlink(s).
Exactly.
That's the approach aufs takes for whiteout and its brothers.
J. R. Okajima
Quoted 13 lines · Bodo Eggert
Quoted 11 lines · Miklos Szeredi
Quoted 9 lines · Valerie Aurora
Quoted 2 lines
- hard links to make sure a separate inode is not necessary for each whiteout/fallthrough entry
The problem with hard links is that you run into hard link limits. I don't think we can do hard links for whiteouts and fallthrus. Each whiteout or fallthru will cost an inode if we implement them as extended attributes. This cost has to be balanced against the cost of implementing them as dentries, which is mainly code complexity in individual file systems.
Quoted 7 lines
Not knowing the details, I'd suggest to implement a generic function to create an attributed inode and let the fs override it to create an unlinked-file-dentry instead.
Benefit: All fs supporting extended attributes will be able to support whiteout. If the fs has other means of supporting whiteout, they may fake the attribute.
Yeah, I think that's the way to go.
Quoted 3 lines
Possible problems:
- Having two ways of reporting a whiteout? Or can it be reported using a (static) fake inode?
They are going to look the same at the VFS level and higher.
Quoted 1 line
- How do you un-whiteout while (not) having an overlaying fs?
The current version of whiteout support always hides DT_WHT dentries from userspace. Perhaps a start is to only hide DT_WHT entries when the file system is union mounted. Applications usually ignore all dentries with d_ino == 0 so it might not cause problems.
Right now, you have to remove whiteouts offline using fsck.
Quoted 9 lines
Quoted 6 lines
get_unlinked_inode()is a great idea. But I feel that individual inodes for each fallthrough is excessive. It'll make the firstreaddir()really really expensive and wastes a lot of disk and memory for no good reason.Not sure how to fix the hard link limits problem though...
Do a hardlink if you can create a hard link, otherwise use a fresh inode and use that for the next hardlink(s).
Bleah! Then you have a code path that is only tested when you hit LINK_MAX. Sounds like a recipe for bugs for me.
-VAL
Quoted 9 lines · Valerie Aurora
Quoted 8 lines · Bodo Eggert
Quoted 7 lines · Miklos Szeredi
On Tue, 17 Aug 2010, Valerie Aurora wrote:
get_unlinked_inode()is a great idea. But I feel that individual inodes for each fallthrough is excessive. It'll make the firstreaddir()really really expensive and wastes a lot of disk and memory for no good reason.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Not sure how to fix the hard link limits problem though...
Do a hardlink if you can create a hard link, otherwise use a fresh inode and use that for the next hardlink(s).
Bleah! Then you have a code path that is only tested when you hit
LINK_MAX. Sounds like a recipe for bugs for me.
You'll also hit it while creating the first whiteout, maybe on creating the first whiteout since mounting, and on filesystems not supporting hardlinks (are there some that support attributes but not hardlinks?). Maybe it will be possible to create immutable whiteout inodes, too.