[lkml]   [2002]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Initial support for struct vfs_cred [0/1]
    >>>>> " " == Trond Myklebust <> writes:

    >>>>> " " == Luca Barbieri <> writes:
    >> For example, rather than this;
    > <snip>

    >> you can just do this:
    >> - uid_t saved_fsuid = current->fsuid;
    >> + uid_t saved_fsuid = current->fscred.uid;
    >> kernel_cap_t saved_cap =
    current-> cap_effective;

    > But I don't want to have to do that at all. Why should I change

    Just to follow up on why the above 'optimization' is just plain wrong.

    You are forgetting that the fscred might simultaneously be referenced
    by an open struct file. Are you saying that this file should suddenly
    see its credential change?
    The alternative without copy on write is to make a full copy of the
    fscred every time we open a file or schedule some form of asynchronous
    I/O, and hence need to cache the current VFS credentials.

    The copy-on-write rule is there in order to *minimize* the need to
    copy the cred. It works because changing the cred's entries is
    supposed to be a *rare* occurrence, whereas taking references and
    reading are common.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:28    [W:0.021 / U:51.652 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site