From patchwork Thu Oct 25 21:51:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 989375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FMTrNgVi"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42h16w3DMqz9sCW for ; Fri, 26 Oct 2018 08:51:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727507AbeJZG0P (ORCPT ); Fri, 26 Oct 2018 02:26:15 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:36874 "EHLO mail-qt1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbeJZG0P (ORCPT ); Fri, 26 Oct 2018 02:26:15 -0400 Received: by mail-qt1-f178.google.com with SMTP id d14-v6so11810999qto.4; Thu, 25 Oct 2018 14:51:50 -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=R13wry7/ZCTyophXBDtsTyFJr/QPjy8SJUCEvCO3YLM=; b=FMTrNgViZ6EhuifFTfh/3UysBf0F5WADlku5/EXYoP78hVdBPYuKNniYuZEin0PXqz CIdcK8HDfbbym0rpdSCnKpIU5RDkW8sb3TyZgegHxDpRasvc0xK2C4qndF1Sz+5wEqKA wddnyrRGZ/+B4jt4luqjBApdz/P6AvvrvM3PHXSbUsfUkQGTkDqMmLtxCKhxKVd/TWyC mpeLiPWkD+V+IUCqrsB1gzS9tTXPEnphxz0ANU1uObULzyWTHVsBU00vqRqEQCL+ZLN8 kInsXKGqTO7/vlcOWBqWNmAmK5f0WEQTOmVDsGiZ9KdgM8u8w5PT7/18NCTymxyxE2WZ MwfQ== 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=R13wry7/ZCTyophXBDtsTyFJr/QPjy8SJUCEvCO3YLM=; b=gz8tD9m7nv+ZzTlgSEGAtcYW3MGjFNVc63kilbk9DEja9b2mZs+l0eMMbd9GQKlk5a JyNYpwgAg3IHHA59PqAeQdpbskLzwiQ39Rwaw9zJ4MKsS4eMQh+cKWSiJY32IL1RNYKH hmjXCyLC+TRljxYpkKprAXqwXFeXVqex82k/uWwfZOeyO4kha9TtAntgMoSblFTqwKyR 60l0Ze1yKsEUq+i3BiCclBLjM6H/bTXKXtdxj2lKBB1A/CREV1wCriV6PAsQQBwZFbHY c3vmYAWW8QA95EPiTNToAasHgecUbVg6cLCNQyktXomYE2YPgfVk2W5PEBcP0j632iO7 8+zw== X-Gm-Message-State: AGRZ1gLMtuSHE0GhlDpwrGOOIq2PjefbNo86a+kQd5tk4KmdY1vp8fY7 zBZsjyOygxsYreyX+3WZMgU= X-Google-Smtp-Source: AJdET5di7CEaIu9KJOmuXbW941C1UdAVXHvIFBd8K05VrsMjE+RboE7c9sIqhD3amlmmjYXnagpp+A== X-Received: by 2002:a0c:9c8c:: with SMTP id i12mr969693qvf.122.1540504310340; Thu, 25 Oct 2018 14:51:50 -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 p64-v6sm5895927qkc.96.2018.10.25.14.51.48 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Oct 2018 14:51:49 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, viro@zeniv.linux.org.uk, smfrench@gmail.com, miklos@szeredi.hu Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-man@vger.kernel.org Subject: [PATCH v3 00/11] client-side support for "inter" SSC copy Date: Thu, 25 Oct 2018 17:51:35 -0400 Message-Id: <20181025215147.36248-1-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org From: Olga Kornievskaia This patch series adds client-side support for doing NFSv4.2 "inter" copy offload between different NFS servers. In case of the "inter" SSC copy files reside on different servers and thus under different superblocks and require that VFS removes the restriction that src and dst files must be on the same superblock. NFS's copy_file_range() determines if the copy is "intra" or "inter" and for "inter" it sends the COPY_NOTIFY to the source server. Then, it would send of an asynchronous COPY to the destination server. If an application cancels an in-flight COPY, OFFLOAD_CANCEL is sent to both of the servers. This patch series also include necessary client-side additions that are performed by the destination server. The server needs an NFS open that represents a source file without doing an actual open. Two function nfs42_ssc_open/nfs42_ssc_close() are introduced to accomplish it that make use of the VFS's alloc_file_pseudo() to represent an open. Also this particular open is marked (NFS_SVC_SSC_COPY_STATE) so that if the destination server ever to receive stateid errors on this stateid, it knows not to initiate state recovery (in case when source server reboots). The recovery must be done by the client and a new copy must be initiated. Therefore, in this case the recovery needs to fail with EIO. v3: -- Combine CIFS,OverlayFS,NFS checks with the VFS patch that relaxed the cross device check. -- Reordered the patches to first enforce cross sb check in NFS, relax it in VFS, then add support to the NFS, then add a patch to NFS to check for the cross fs type instead. -- fixed kbuild suggestion to change PTR_ERR to PTR_ERR_OR_ZERO Olga Kornievskaia (11): VFS move cross device copy_file_range() check into filesystems VFS copy_file_range check validity of input source offset NFS NFSD defining nl4_servers structure needed by both NFS add COPY_NOTIFY operation NFS add ca_source_server<> to COPY NFS also send OFFLOAD_CANCEL to source server NFS inter ssc open NFS skip recovery of copy open on dest server NFS for "inter" copy treat ESTALE as ENOTSUPP NFS COPY handle ERR_OFFLOAD_DENIED NFS replace cross device with cross filesystem check in copy_file_range Documentation/filesystems/porting | 7 ++ Documentation/filesystems/vfs.txt | 6 +- fs/cifs/cifsfs.c | 2 + fs/nfs/nfs42.h | 15 ++- fs/nfs/nfs42proc.c | 129 ++++++++++++++++++++++--- fs/nfs/nfs42xdr.c | 193 +++++++++++++++++++++++++++++++++++++- fs/nfs/nfs4_fs.h | 10 ++ fs/nfs/nfs4client.c | 2 +- fs/nfs/nfs4file.c | 122 +++++++++++++++++++++++- fs/nfs/nfs4proc.c | 6 +- fs/nfs/nfs4state.c | 14 +++ fs/nfs/nfs4xdr.c | 1 + fs/overlayfs/file.c | 3 + fs/read_write.c | 12 +-- include/linux/nfs4.h | 25 +++++ include/linux/nfs_fs_sb.h | 1 + include/linux/nfs_xdr.h | 17 ++++ 17 files changed, 539 insertions(+), 26 deletions(-)