From patchwork Fri Nov 30 20:42:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10707181 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 4FD1613B0 for ; Fri, 30 Nov 2018 20:42:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40FC73023E for ; Fri, 30 Nov 2018 20:42:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34D0A3022A; Fri, 30 Nov 2018 20:42:44 +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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 C3F6C3024A for ; Fri, 30 Nov 2018 20:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726409AbeLAHxN (ORCPT ); Sat, 1 Dec 2018 02:53:13 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:55594 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbeLAHxN (ORCPT ); Sat, 1 Dec 2018 02:53:13 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAUKciPX121853; Fri, 30 Nov 2018 20:42:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=1C0aoUQG0vVGaG/5z4BBKo1HcMPIceCTXGKp1CMfsLk=; b=k+VBu8nitpGCsI5NQc7CgB39XaFC85VaYjuVKFwyY+MX2l/2TZYaWbCXMg8oRo20k7R0 aeRpnjlnKSrITQX2V2CBF546AZjv0fFY4LrhH9EJSznlG8dIhzH/xnDE2h1CDYBn97rX DF6U4odChlU8KVlWeUHCl3ftYOlHDX4Ot8cHAF4aNBnScviJWJy/xm3qbg9xAFqMzvr/ ZG6tt0NCAaAn7WHXD4go/wqKa4DtX6NYISHyDwaiJcpIk/JjnIL/uBDeQE6oQpmOdRfT mD8VLe3SUrM18hyhSOs6xluYslEzw0NyyKNQ0RH5fiRpEvd6vbmfaJxZyvpO311NpDcy 0w== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2p2jf0qkg4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Nov 2018 20:42:40 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wAUKgd5b019925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Nov 2018 20:42:40 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wAUKgd7K030725; Fri, 30 Nov 2018 20:42:39 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 30 Nov 2018 12:42:39 -0800 Date: Fri, 30 Nov 2018 12:42:38 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: xfs , linux-fsdevel , amir73il@gmail.com, linux-unionfs@vger.kernel.org Subject: [PATCH] vfs: allow remap flags to be passed to vfs_clone_file_range Message-ID: <20181130204238.GE8131@magnolia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9093 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=760 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811300176 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong In overlayfs, ovl_remap_file_range calls vfs_clone_file_range on the lower filesystem's inode, passing through whatever remap flags it got from its caller. Since vfs_copy_file_range first tries a filesystem's remap function with REMAP_FILE_CAN_SHORTEN, this can get passed through to the second vfs_copy_file_range call, which isn't an issue. Remove the WARN_ON because it's unnecessary. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein Reviewed-by: Christoph Hellwig --- fs/read_write.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index 4dae0399c75a..2d9fed57e7dd 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1956,8 +1956,6 @@ loff_t do_clone_file_range(struct file *file_in, loff_t pos_in, struct inode *inode_out = file_inode(file_out); loff_t ret; - WARN_ON_ONCE(remap_flags); - if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode)) return -EISDIR; if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode))