From patchwork Thu Jun 26 19:11:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4430151 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CC0C6BEEAA for ; Thu, 26 Jun 2014 19:13:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8DFD201BB for ; Thu, 26 Jun 2014 19:13:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17CBE2028D for ; Thu, 26 Jun 2014 19:13:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751371AbaFZTNw (ORCPT ); Thu, 26 Jun 2014 15:13:52 -0400 Received: from mail-qa0-f45.google.com ([209.85.216.45]:57267 "EHLO mail-qa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbaFZTNv (ORCPT ); Thu, 26 Jun 2014 15:13:51 -0400 Received: by mail-qa0-f45.google.com with SMTP id v10so3161024qac.18 for ; Thu, 26 Jun 2014 12:13:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=X+RZuqBRxRUxzsrZtzg9Uv91ZZEWY+BlXTYVzeUEUoA=; b=miXisHO3pLTgjFHt9mSIr34iVA7QW694AIdWtuWmUEuxmRqWMxzjkiEg9GY/q4YwGx //402Uid1Ed01twMZlFTuc4dMdE4cWSH/Ar0kN7dHHO5LU4dLBkrVzm0QW2tzEwDlkB5 6+R9S/rYygj+ak+d/sWPSmBfuTdq8oGE+AXXGKJNhXMyCGdSCX13rt38MCxINIodPgFJ rXcWoSLg/AAXODdZZHKSFGSy6FUptbhb8ZE/gJpOzeitJq40xo70/AGWXGk0nu6+ggLi L26wSGz4uQ9bit2y2c9FTp6/rEH9dGQ6dJxijeO5Q3JiG15qknE08a/VluK1aNkqVivA Chgg== X-Gm-Message-State: ALoCoQnQNMaxnHpClGUOKiDHU+iX/YBwlpP669AQHiSVn9W+lUN3cWjNxWQDxx955SES286rTYR8 X-Received: by 10.224.165.70 with SMTP id h6mr25696027qay.78.1403810031007; Thu, 26 Jun 2014 12:13:51 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id 88sm4763039qgh.5.2014.06.26.12.13.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jun 2014 12:13:50 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 003/117] nfsd: add __force to opaque verifier field casts Date: Thu, 26 Jun 2014 15:11:43 -0400 Message-Id: <1403810017-16062-4-git-send-email-jlayton@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1403810017-16062-1-git-send-email-jlayton@primarydata.com> References: <1403810017-16062-1-git-send-email-jlayton@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sparse complains that we're stuffing non-byte-swapped values into __be32's here. Since they're supposed to be opaque, it doesn't matter much. Just add __force to make sparse happy. Reviewed-by: Christoph Hellwig Signed-off-by: Jeff Layton --- fs/nfsd/nfs4proc.c | 8 ++++++-- fs/nfsd/nfs4state.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 6851b003f2a4..8904c9cbcb89 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -581,8 +581,12 @@ static void gen_boot_verifier(nfs4_verifier *verifier, struct net *net) __be32 verf[2]; struct nfsd_net *nn = net_generic(net, nfsd_net_id); - verf[0] = (__be32)nn->nfssvc_boot.tv_sec; - verf[1] = (__be32)nn->nfssvc_boot.tv_usec; + /* + * This is opaque to client, so no need to byte-swap. Use + * __force to keep sparse happy + */ + verf[0] = (__force __be32)nn->nfssvc_boot.tv_sec; + verf[1] = (__force __be32)nn->nfssvc_boot.tv_usec; memcpy(verifier->data, verf, sizeof(verifier->data)); } diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index f9049516bfae..c473bd6d52c8 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1421,8 +1421,12 @@ static void gen_confirm(struct nfs4_client *clp) __be32 verf[2]; static u32 i; - verf[0] = (__be32)get_seconds(); - verf[1] = (__be32)i++; + /* + * This is opaque to client, so no need to byte-swap. Use + * __force to keep sparse happy + */ + verf[0] = (__force __be32)get_seconds(); + verf[1] = (__force __be32)i++; memcpy(clp->cl_confirm.data, verf, sizeof(clp->cl_confirm.data)); }