| Date | Mon, 30 Nov 2009 23:50:13 -0500 | From | Erez Zadok <> | Subject | Re: [PATCH 40/41] union-mount: Make truncate work in all its glorious UNIX variations |
| |
In message <1256152779-10054-41-git-send-email-vaurora@redhat.com>, Valerie Aurora writes: > Implement truncate(), ftruncate(), and open(O_TRUNC) for union mounts. > > This moves the union_copyup() in do_filp_open() down below may_open() > - this way you don't copy up a file you don't even have permission to > open. > > may_open() now takes a nameidata * because it may have to do a > union_copyup() internally if O_TRUNC is specified. It's a trivial > change, all callers were just doing "may_open(&nd.path, ...)" anyway. > It kinda sucks, but may_open() auto-magically doing a truncate also > sucks (may open? may truncate, too!).
Hmmm, perhaps may_open needs to be renamed then? (may_rename_and_truncate?)
> XXX - Only copy up the bytes that won't be truncated. > XXX - Re-organize code. may_open() especially blah. > XXX - truncate() implemented as in-kernel file open and ftruncate() > XXX - Split up into smaller pieces [...]
Erez.
|