From patchwork Sun Mar 3 09:02:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ycnian@gmail.com X-Patchwork-Id: 2208031 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9B39D3FC8F for ; Sun, 3 Mar 2013 09:02:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752668Ab3CCJCZ (ORCPT ); Sun, 3 Mar 2013 04:02:25 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:60351 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634Ab3CCJCY (ORCPT ); Sun, 3 Mar 2013 04:02:24 -0500 Received: by mail-pa0-f54.google.com with SMTP id fa10so2597212pad.27 for ; Sun, 03 Mar 2013 01:02:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=6KO/+4Sv2uYrEQf2/ICQGXDMaeAwgLtl3JHS2Yw2AkY=; b=mPuSx5Fq5qSt4StU8y8w2HomLo5mRXRyZb2kxajTA5U3ZgSqfVUcWC+2hN4xZ6r5Bf mL10gYS2DqbtwAkc1s9qFT58WqdY9l5D0uMB61+K/kEZ7dLW4xFAExEgXzDgFj1Dcqld FPVpqoRFJj/YyWq1o6nnpDRyc3Zm8VXMl1cf/M83sQ7T5dm5EYHEs6HeSftZZMMLnToZ PAanlqRVq9Ucom7dwlzAtirfGtntBBc1JA2Uqb8gRAkI/69DVuF+b9mO7bhuWUgFNVZy SBumTqgcqZPi6W43NTqMb2jHIt5WHfgoFBJ9JtfOyUDDr1rTDOEfu6cYCbFZQzCNaIpW Nqeg== X-Received: by 10.68.196.129 with SMTP id im1mr22595112pbc.206.1362301343658; Sun, 03 Mar 2013 01:02:23 -0800 (PST) Received: from localhost ([123.125.33.171]) by mx.google.com with ESMTPS id dx17sm19577588pac.17.2013.03.03.01.02.18 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 03 Mar 2013 01:02:22 -0800 (PST) Date: Sun, 3 Mar 2013 17:02:11 +0800 From: Yanchuan Nian To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH] nfsd: Correct read access checking Message-ID: <20130303090211.GA29550@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org NFS4_SHARE_ACCESS_WRITE should not be tested in access_permit_read() for this function just tests read permission, so remove it. Signed-off-by: Yanchuan Nian --- fs/nfsd/nfs4state.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 16d39c6..75c873d 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3322,8 +3322,7 @@ static inline int access_permit_read(struct nfs4_ol_stateid *stp) { return test_access(NFS4_SHARE_ACCESS_READ, stp) || - test_access(NFS4_SHARE_ACCESS_BOTH, stp) || - test_access(NFS4_SHARE_ACCESS_WRITE, stp); + test_access(NFS4_SHARE_ACCESS_BOTH, stp); } static inline int