Re: [PATCH] cred: remove const qualifiers

From: David Howells
Date: Thu Aug 21 2008 - 09:24:32 EST


Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> That information should have been included in a code comment.

It was explained in the covering note:

Subject: [PATCH 00/24] Introduce credentials [ver #7]
...
(c) task_struct::cred is a const struct cred *, as are all pointers
that aren't used specifically for creating new credentials. This
catches places that are changing creds when they shouldn't be at
compile time.

To get a new ref on a const cred, use get_cred() which casts away
the const and calls atomic_inc().

It should've gone in the log entry for the "CRED: Inaugurate COW credentials"
patch and also into the documentation. I don't know whether I can amend the
former, but I can amend the latter. I'll also amend the comment to make it
crystal clear.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/