From patchwork Thu Sep 26 18:42:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950461 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 F067DBFF0B for ; Thu, 26 Sep 2013 18:42:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 09EDB202DD for ; Thu, 26 Sep 2013 18:42:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D89492017B for ; Thu, 26 Sep 2013 18:42:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754095Ab3IZSme (ORCPT ); Thu, 26 Sep 2013 14:42:34 -0400 Received: from mail-qc0-f171.google.com ([209.85.216.171]:56319 "EHLO mail-qc0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553Ab3IZSmd (ORCPT ); Thu, 26 Sep 2013 14:42:33 -0400 Received: by mail-qc0-f171.google.com with SMTP id x19so1050723qcw.30 for ; Thu, 26 Sep 2013 11:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lb2yrFVrt6Io+T6hoKJZl/Ed9iDxwR+gbVa1EY/Hs1A=; b=if+vn/RQMbO5fVgTcHkadv0Xqp7oomAAgdtDKxKPB7tuMh60sayDXW41h0NpuDzxqt KezGLXfRr9uVx9hIR5dAyzJUrimaEtEVyPuBwB3mBhKwTG2EhaGHmPHN/ZdUwj64yKCy QC6SEoPlr2aiHmg2AHNFytacGKcQXLD+2YjANr/7XvNIF0w/17eZZDusr0+HZmRCTAzu RyYILfmkYY/FZn4agHygN+DPpMhaVEny2Z2vpTk2QQxfdINeHMl3QFmcBeFcEi5Rcx3V sqV6cO7qhgIGJSPYl/lohZP9C5RabivdnxI7Lbp0PQvL6wh6RFEEFU9KvzyZEc0BsAsV BL1Q== X-Received: by 10.49.39.39 with SMTP id m7mr3652243qek.60.1380220952950; Thu, 26 Sep 2013 11:42:32 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com.com (nat-pool-bos-u.redhat.com. [66.187.233.207]) by mx.google.com with ESMTPSA id m6sm10237893qaa.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:42:32 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 39/49] pnfsd: DLM file layout only support read iomode layouts Date: Thu, 26 Sep 2013 14:42:30 -0400 Message-Id: <1380220950-14484-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <52447EA0.7070004@primarydata.com> References: <52447EA0.7070004@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=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Andy Adamson In a DLM cluster, writing to a node other than the node where the open call occurred (where meta data is cached) will have performance implications when the write causes meta data changes that need to be propagated to the open call node. DlM clusters support only LAYOUTIOMODE4_READ layouts. Writes will go through the MDS. Return NFS4ERR_BADIOMODE for LAYOUTGET requests with LAYOUTIOMODE4_RW iomode. Signed-off-by: Andy Adamson [pnfsd: fixup DLM layout_get return type to u32] Signed-off-by: Benny Halevy Signed-off-by: Benny Halevy --- fs/nfsd/nfs4pnfsdlm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/nfsd/nfs4pnfsdlm.c b/fs/nfsd/nfs4pnfsdlm.c index 7ed8156..acc1f91 100644 --- a/fs/nfsd/nfs4pnfsdlm.c +++ b/fs/nfsd/nfs4pnfsdlm.c @@ -390,6 +390,10 @@ static enum nfsstat4 nfsd4_pnfs_dlm_layoutget(struct inode *inode, dprintk("%s: LAYOUT_GET\n", __func__); + /* DLM exported file systems only support layouts for READ */ + if (res->lg_seg.iomode == IOMODE_RW) + return NFS4ERR_BADIOMODE; + index = dlm_ino_hash(inode); dprintk("%s first stripe index %d i_ino %lu\n", __func__, index, inode->i_ino);