From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40663C433E0 for ; Tue, 16 Jun 2020 16:35:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24B2E208D5 for ; Tue, 16 Jun 2020 16:35:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Gm4lLSM9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730048AbgFPQfA (ORCPT ); Tue, 16 Jun 2020 12:35:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729810AbgFPQfA (ORCPT ); Tue, 16 Jun 2020 12:35:00 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B867BC061573; Tue, 16 Jun 2020 09:34:59 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id a13so2372929ilh.3; Tue, 16 Jun 2020 09:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EeczCUw4VGlryDikP+LHTZeK1GFAMCPROD0ZhbqnYrs=; b=Gm4lLSM9A+ctS8aVhfaAp6qbML4FqeZpMI7uwG1szAIWWByRgnf6lYMM7YxjCs18Xu zgP9RlQzdlNf0SjhUH3nm/TCMgPGz37e4EjIeMEdb3ViMXGqzUYSZ6mo4E8TFfn1jLHc TiUVh+nIsWJXTgUNmz4Xon/LcWRCknH6eJxpPEVAhdjArmMm1Y5lME0+9LrS/AasNObd jF/bku34fQs3sSfexAwy6V4XQdKftex58/sCvmkl2BAwsrpH2apC/EiCOoFibwycCXD6 cmvJVpYLr6NbbxziA06lF8RxJjxTBm9++5hYVJ/O05yRU15w9gYN+WUHUvLdvDG/d6gh 27PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EeczCUw4VGlryDikP+LHTZeK1GFAMCPROD0ZhbqnYrs=; b=k9hZpFy2w3kYEJfRJNGPKTz0IfzIZuETziH5KrKCCEt5cfMWLVjEk/h23ba/njqrjK EkOgcAi4F8j56osTGwjGWGwcOJePxkm7jLp/+SKAe0gWX+y030579OL/ijBm2vO4IeY5 5ygylp34hbeWGUgcFLpTjERLHMTMaT21iSh8JlC/Bx88QNa2ff5HmBw6rFtU8sPWu0DN xWtcSvZkjYN+eH8+sNlr4fncAbTqsItVNqBqjLsYQIv5nmyIaLcgHU7+G58130Tp7i5D P3bvu1oB1Pz7T7LQV7bvea0znzjr1P9gZD9ruooksew2mYSvMgB7cdDuG7wnWaBPLXOd XHBg== X-Gm-Message-State: AOAM530M52dnQ8sUw+Wyjzvzkirz9bW1huEG4jE/C/nrIcTp/yquJW9z rWVOJqtJJpsMTwv8lAsxLXteSoDyCf05sSCTDBM= X-Google-Smtp-Source: ABdhPJxhXeenFpS1jYvSlQ/I3w3cQQR0OvU6gkywev0NM2wczThH3Sn2nTDqy+hP8sM78NP4aHnJjIzazj0QOT+10iQ= X-Received: by 2002:a92:1fc7:: with SMTP id f68mr4208040ilf.133.1592325298784; Tue, 16 Jun 2020 09:34:58 -0700 (PDT) MIME-Version: 1.0 References: <20200615160244.741244-1-agruenba@redhat.com> <20200615233239.GY2040@dread.disaster.area> <20200615234437.GX8681@bombadil.infradead.org> <20200616003903.GC2005@dread.disaster.area> <315900873.34076732.1592309848873.JavaMail.zimbra@redhat.com> <20200616132318.GZ8681@bombadil.infradead.org> <20200616162539.GN11245@magnolia> In-Reply-To: <20200616162539.GN11245@magnolia> From: =?UTF-8?Q?Andreas_Gr=C3=BCnbacher?= Date: Tue, 16 Jun 2020 18:34:47 +0200 Message-ID: Subject: Re: [PATCH] iomap: Make sure iomap_end is called after iomap_begin To: "Darrick J. Wong" Cc: Andreas Gruenbacher , Matthew Wilcox , Bob Peterson , Dave Chinner , Christoph Hellwig , linux-xfs , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Am Di., 16. Juni 2020 um 18:26 Uhr schrieb Darrick J. Wong : > On Tue, Jun 16, 2020 at 03:57:08PM +0200, Andreas Gruenbacher wrote: > > On Tue, Jun 16, 2020 at 3:23 PM Matthew Wilcox wrote: > > > On Tue, Jun 16, 2020 at 08:17:28AM -0400, Bob Peterson wrote: > > > > ----- Original Message ----- > > > > > > I'd assume Andreas is looking at converting a filesystem to use iomap, > > > > > > since this problem only occurs for filesystems which have returned an > > > > > > invalid extent. > > > > > > > > > > Well, I can assume it's gfs2, but you know what happens when you > > > > > assume something.... > > > > > > > > Yes, it's gfs2, which already has iomap. I found the bug while just browsing > > > > the code: gfs2 takes a lock in the begin code. If there's an error, > > > > however unlikely, the end code is never called, so we would never unlock. > > > > It doesn't matter to me whether the error is -EIO because it's very unlikely > > > > in the first place. I haven't looked back to see where the problem was > > > > introduced, but I suspect it should be ported back to stable releases. > > > > > > It shouldn't just be "unlikely", it should be impossible. This is the > > > iomap code checking whether you've returned an extent which doesn't cover > > > the range asked for. I don't think it needs to be backported, and I'm > > > pretty neutral on whether it needs to be applied. > > > > Right, when these warnings trigger, the filesystem has already screwed > > up; this fix only makes things less bad. Those kinds of issues are > > very likely to be fixed long before the code hits users, so it > > shouldn't be backported. > > > > This bug was in iomap_apply right from the start, so: > > > > Fixes: ae259a9c8593 ("fs: introduce iomap infrastructure") > > So... you found this through code inspection, and not because you > actually hit this on gfs2, or any of the other iomap users? Bob did, yes. I've only hit those warnings in the very early stages of gfs2 iomap development, long before that code was even posted for review. > I generally think this looks ok, but I want to know if I should be > looking deeper. :) It's really supposed to be a simple, straight forward fix only. Thanks, Andreas