tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: struct file reference at VFS level



Emmanuel Dreyfus writes:
> matthew green <mrg%eterna.com.au@localhost> wrote:
> 
> > you do realise that kauth_cred_t is shared across processes in 
> > some cases but not all, right?
> 
> VFS uses a kauth_cred_t from struct file f_cred field, which is tied to
> the struct file. The value is initialized as curlwp->l_cred in
> fd_allocfile(). 
> 
> My proposed patch replaces this f_cred by an augmented copy in
> open_setfp().

so you want to create an entirely separate copy of kauth_cred_t for
every file opened like this just to provide a single ID?  that is a
huge waste of space:

(gdb) p sizeof(struct kauth_cred)
$2 = 176

currently the vast majority of kauth_cred_t's are shared.

> > i don't think kauth_cred_t is the right place to try to store
> > random crap related to file systems.
> 
> Where do you think that data should go?

i don't know, but not in kauth_cred_t.  don't go linking systems
together like that.  don't abuse kauth to shove some random other
data you need simply because that's a place you found you could
change.  the usage of it in VFS is as a consumer, not as a storage
mechanism.


.mrg.


Home | Main Index | Thread Index | Old Index