From patchwork Fri Oct 19 15:28:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10649631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48C4D13A4 for ; Fri, 19 Oct 2018 15:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D2F027F91 for ; Fri, 19 Oct 2018 15:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2140C27F94; Fri, 19 Oct 2018 15:29:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D91E27F91 for ; Fri, 19 Oct 2018 15:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726848AbeJSXfp (ORCPT ); Fri, 19 Oct 2018 19:35:45 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:45456 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbeJSXfp (ORCPT ); Fri, 19 Oct 2018 19:35:45 -0400 Received: by mail-qt1-f193.google.com with SMTP id e10-v6so38706066qtq.12 for ; Fri, 19 Oct 2018 08:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=AEvIqTh7py+WvdWDRNFcCsZo+JqVYauzIV/OvCOenEQ=; b=YrKrG3OgS+mRKr29sLidbenwBeTE7Vpo7MnXbFXNOPiJEPTrHajL0f9XSIqjulQgRi bM8NnOTwl4IYaREH4NvA3FTmVyYSrh3OkHj5TVSqlaMPlGK6Nd8Ap/EWTiSHHyopnUnN Xk2RG6qrANPLvgCXH3nSNMtIJTE8M5bdgElUnqGnYCivjkDOoggnMuxupYj8JzezO1iY p1Azb7AEU3UrKsrAo6d7KY1ngHruALK3IsspxvaCJSwjDZ8iN+4PRCjX/BRPF06j3SNU JDlc9CJhMLdInI2eHPkOP0SR1QwbgE9ma626OXUL/wlaJwWuJAItPKN1nIvs5BVbUANN rdjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AEvIqTh7py+WvdWDRNFcCsZo+JqVYauzIV/OvCOenEQ=; b=X/JIYV9Z3g0fYp6KCk8sXvNx3SP08SdxcV6GO25uMGYDZdvudy0nniQex2aSFb/hf2 aau6eIoOiNl30CsUi02QIst7NPSTVr8sKnEUefvA4R5xYV+CBiU+qqclECd6Z8xoOHob /9MJ0+Bu8g/N4Xqw7hZMdp3aijyR/ACFXl56BEyQyxFtNPrN3CptrW8JvS9SNuRrhLlb iMAPoHUjLpUYaDsMtmqH7sEl+tkcfyPJ2nEfIgkQC9MB7NjdDzb77Iw4p2XiX63oRVe+ K9vFDYlLGdXrrvDGBcyxqGrEY8ZkIka/XyGbP2E33PGRUTiISaP4D7osx92vrT8zwp3j rusQ== X-Gm-Message-State: ABuFfoj1KKBlzLrQWR3zOfylHrypxwn5loA+Uzb2lHjhqEpxKS0zfTfG q3+GptCNyxaX2dREAyEp4iM= X-Google-Smtp-Source: ACcGV61yy16pz/T3DJEFiq3rnVFsEevvpMC1ima/DP2lFaLXEnFXnTGVqQgNdjmpbQQr8zOY5KMaYA== X-Received: by 2002:a0c:eccd:: with SMTP id o13mr26012569qvq.42.1539962949872; Fri, 19 Oct 2018 08:29:09 -0700 (PDT) Received: from Olgas-MBP-195.attlocal.net (172-10-226-31.lightspeed.livnmi.sbcglobal.net. [172.10.226.31]) by smtp.gmail.com with ESMTPSA id s17-v6sm18126231qtj.31.2018.10.19.08.29.08 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 19 Oct 2018 08:29:08 -0700 (PDT) From: Olga Kornievskaia To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 00/13] server-side support for "inter" SSC copy Date: Fri, 19 Oct 2018 11:28:52 -0400 Message-Id: <20181019152905.32418-1-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch series adds support for NFSv4.2 copy offload feature allowing copy between two different NFS servers. This feature is enabled by the kernel module parameter -- inter_copy_offload_enable -- and by default is disabled. There is also a kernel compile configuration of NFSD_V4_2_INTER_SSC that adds dependency on the NFS client side functions called from the server. These patches work on top of 4 existing async intra copy offload patches. For the "inter" SSC, the implementation only supports asynchronous inter copy. On the source server, upon receiving a COPY_NOTIFY, it generate a unique stateid that's kept in the global list. Upon receiving a READ with a stateid, the code checks the normal list of open stateid and now additionally, it'll check the copy state list as well before deciding to either fail with BAD_STATEID or find one that matches. The stored stateid is only valid to be used for the first time with a choosen lease period (90s currently). When the source server received an OFFLOAD_CANCEL, it will remove the stateid from the global list. Otherwise, the copy stateid is removed upon the removal of its "parent" stateid (open/lock/delegation stateid). On the destination server, upon receiving a COPY request, the server establishes the necessary clientid/session with the source server. It calls into the NFS client code to establish the necessary open stateid, filehandle, file description (without doing an NFS open). Then the server calls into the copy_file_range() to preform the copy where the source file will issue NFS READs and then do local file system writes (this depends on the VFS ability to do cross device copy_file_range(). Client-side patches are included for the ease of testing. Anna Schumaker (1): fs: Don't copy beyond the end of the file Olga Kornievskaia (12): VFS permit cross device vfs_copy_file_range NFS NFSD defining nl4_servers structure needed by both NFS inter ssc open NFS skip recovery of copy open on dest server NFSD fill-in netloc4 structure NFSD add ca_source_server<> to COPY NFSD return nfs4_stid in nfs4_preprocess_stateid_op NFSD add COPY_NOTIFY operation NFSD check stateids against copy stateids NFSD generalize nfsd4_compound_state flag names NFSD: allow inter server COPY to have a STALE source server fh NFSD add nfs4 inter ssc to nfsd4_copy Documentation/filesystems/vfs.txt | 4 +- fs/nfs/nfs4_fs.h | 8 + fs/nfs/nfs4file.c | 99 +++++++++ fs/nfs/nfs4proc.c | 5 +- fs/nfs/nfs4state.c | 14 ++ fs/nfsd/Kconfig | 10 + fs/nfsd/nfs4proc.c | 433 +++++++++++++++++++++++++++++++++++--- fs/nfsd/nfs4state.c | 128 +++++++++-- fs/nfsd/nfs4xdr.c | 168 ++++++++++++++- fs/nfsd/nfsd.h | 31 ++- fs/nfsd/nfsfh.h | 5 +- fs/nfsd/nfssvc.c | 6 + fs/nfsd/state.h | 18 +- fs/nfsd/xdr4.h | 26 ++- fs/read_write.c | 16 +- include/linux/nfs4.h | 25 +++ 16 files changed, 929 insertions(+), 67 deletions(-)