SUNRPC: Enforce atomic updates of rpc_cred->cr_flags
[linux-2.6-block.git] / net / sunrpc / auth_unix.c
index f17dabbab1c721bc23e6a7c3dd0bd818403e0b9b..29d50ffa69d698408a8add1f22405f9f585aee8b 100644 (file)
@@ -72,7 +72,7 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
                return ERR_PTR(-ENOMEM);
 
        rpcauth_init_cred(&cred->uc_base, acred, auth, &unix_credops);
-       cred->uc_base.cr_flags = RPCAUTH_CRED_UPTODATE;
+       cred->uc_base.cr_flags = 1UL << RPCAUTH_CRED_UPTODATE;
        if (flags & RPCAUTH_LOOKUP_ROOTCREDS) {
                cred->uc_uid = 0;
                cred->uc_gid = 0;
@@ -172,7 +172,7 @@ unx_marshal(struct rpc_task *task, __be32 *p)
 static int
 unx_refresh(struct rpc_task *task)
 {
-       task->tk_msg.rpc_cred->cr_flags |= RPCAUTH_CRED_UPTODATE;
+       set_bit(RPCAUTH_CRED_UPTODATE, &task->tk_msg.rpc_cred->cr_flags);
        return 0;
 }