From patchwork Mon Nov 19 21:17:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 10689483 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 BF6FA13BB for ; Mon, 19 Nov 2018 21:17:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4E6A2A651 for ; Mon, 19 Nov 2018 21:17:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8B472A68A; Mon, 19 Nov 2018 21:17:52 +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=-7.9 required=2.0 tests=BAYES_00,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 63B732A651 for ; Mon, 19 Nov 2018 21:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730057AbeKTHnV (ORCPT ); Tue, 20 Nov 2018 02:43:21 -0500 Received: from ipmail03.adl6.internode.on.net ([150.101.137.143]:6069 "EHLO ipmail03.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbeKTHnU (ORCPT ); Tue, 20 Nov 2018 02:43:20 -0500 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail03.adl6.internode.on.net with ESMTP; 20 Nov 2018 07:47:46 +1030 Received: from discord.disaster.area ([192.168.1.111]) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1gOqvQ-0000ZP-WF; Tue, 20 Nov 2018 08:17:45 +1100 Received: from dave by discord.disaster.area with local (Exim 4.91) (envelope-from ) id 1gOqvQ-0002Pz-Sn; Tue, 20 Nov 2018 08:17:44 +1100 From: Dave Chinner To: linux-xfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH 0/5] iomap: data corruption fixes and more Date: Tue, 20 Nov 2018 08:17:37 +1100 Message-Id: <20181119211742.8824-1-david@fromorbit.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi folks, Since clone/dedupe/copy_file_range support was added to fsx, I've found several data corruptions and issues with these functions. The patchset addresses some of the issues I've found, including a problem with the FUA optimisation that I found by inspection when looking at this code. Several of the problems stem from do_splice_direct() and how it behaves on files opened O_DIRECT. I'm pretty sure this has never been tested on XFS because it just doesn't work and has stale data exposure problems. And it's so slow it's not funny because it can only shuffle 16 pages at a time through the splice pipe, which means synchronous 64k IO for large data movement. do_splice_direct() is a horrible data copying primitive. The first 3 patches are data integrity/corruption fixes for the iomap code, patch 4 increases the do_splice_direct() pipe size to the maximum allowed without privilege to improve performance, and the last patch fixes an error reporting inconsistency between dedeupe and the documented errors in the man page. Cheers, Dave.