Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp892204yba; Thu, 18 Apr 2019 11:18:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQ3nLzQp9oBr6CtqB3qCmS0tyBYj0uMeFmzhHHkz/1nwqS5+U8+3mbVpZ8BbIGJ5n1ePlN X-Received: by 2002:a65:5549:: with SMTP id t9mr77349125pgr.388.1555611518989; Thu, 18 Apr 2019 11:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611518; cv=none; d=google.com; s=arc-20160816; b=cp+7v2gMdUOlL5l3ATPvlFOpWtcWB34L++VL8Ca7ueANJHbYi8qFZ3Z6orYZeR5VyI hfyvglIc6nozkz1dAaotF5hw7nG5j+/FCRb9MdzxNcLq6KO5/7Znd/j7Ce0jnqu8OkN3 esqn8rNvc+px0r06ANqxY5XNz4JBMe+72GaEtXblxNHtLzygYZ7rclIwvVfl9StvBRAU GbB6chIkxnoDE77bC8tMpVhL51a1IqkjrB81vUqRWLoaUaRYuRIOl9xH/NjcoPM/qluo p/TPKIgr3CHfnQF7/V/Rr6WfdE82VqNa1Zql/LHfrTotLT0e54GKz1BsqwO0mSzzFrfz AO2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4A9EHCKalcuRYXT51I/pdx1CoCDeYdVcme+Pfjd2v6k=; b=h/JhKspIMONvoYu6Wyu+V3f40j5N04IhDluwnR/OeNBQpz0zFH6MUzgcjcKLgNPoid A1eRs0LiRDC9wC2bIH3s2LK34eQ1IpdU6c9J6lr37e3/1TaUnnu3IiKpfbVpLmfP3bcp H4swk4Jy9B65yJgeu2TjuYkqXV/q/bxfrebLYNQlS+0np6YLYZ63Z56YljqUjYshVML3 41NWT+ttgjioBOSViNHa5rrCdEAvateCsoBVOHRnKH9O8hVA2BDtd6E420fyGOdU7dHL WdopJCZQgbYlhwWswGDbHWESqj4d0OCH376hcWFc7OxG9JgsfbekUls28MYeiBRegj08 WIvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aNVZZ9Qz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15si2854695pfr.242.2019.04.18.11.18.24; Thu, 18 Apr 2019 11:18:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aNVZZ9Qz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404035AbfDRSMO (ORCPT + 99 others); Thu, 18 Apr 2019 14:12:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:44656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404023AbfDRSML (ORCPT ); Thu, 18 Apr 2019 14:12:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C853B20675; Thu, 18 Apr 2019 18:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611131; bh=jwarXQ2rAaD+Lul8YZOEmkG7/qgB9YOYlc5Fd8EKVTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aNVZZ9QzjT9Nn7HkX4yvLWloyug3ryAQKN6PSW5I1QtDvJbk9fZ9I5Vq2TQaPFoQW H4V5cbNT0uVMlc4zu3B2ONPCQrsUtV+cuwWJ0g8BLFZxhh/43OPWgw5kSKcteY3tlO 99/PgGEDKtwCXLxBki5NETJjN6xAfADgJVdMjMC0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaoli Feng , Steve French , Sasha Levin Subject: [PATCH 5.0 63/93] cifs: fix that return -EINVAL when do dedupe operation Date: Thu, 18 Apr 2019 19:57:41 +0200 Message-Id: <20190418160443.795009817@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit b073a08016a10f01dfb0d0b6c7fa89da0d544963 ] dedupe_file_range operations is combiled into remap_file_range. But it's always skipped for dedupe operations in function cifs_remap_file_range. Example to test: Before this patch: # dd if=/dev/zero of=cifs/file bs=1M count=1 # xfs_io -c "dedupe cifs/file 4k 64k 4k" cifs/file XFS_IOC_FILE_EXTENT_SAME: Invalid argument After this patch: # dd if=/dev/zero of=cifs/file bs=1M count=1 # xfs_io -c "dedupe cifs/file 4k 64k 4k" cifs/file XFS_IOC_FILE_EXTENT_SAME: Operation not supported Influence for xfstests: generic/091 generic/112 generic/127 generic/263 These tests report this error "do_copy_range:: Invalid argument" instead of "FIDEDUPERANGE: Invalid argument". Because there are still two bugs cause these test failed. https://bugzilla.kernel.org/show_bug.cgi?id=202935 https://bugzilla.kernel.org/show_bug.cgi?id=202785 Signed-off-by: Xiaoli Feng Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/cifsfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 07cad54b84f1..e8e125acd712 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -1010,7 +1010,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off, unsigned int xid; int rc; - if (remap_flags & ~REMAP_FILE_ADVISORY) + if (remap_flags & ~(REMAP_FILE_DEDUP | REMAP_FILE_ADVISORY)) return -EINVAL; cifs_dbg(FYI, "clone range\n"); -- 2.19.1