Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1363748pxu; Sat, 24 Oct 2020 08:23:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx6hx2uQi2QUsJWQghIHSijdL2cmpsAYIyP9umO1jaCHQmPgRgBXssMOP8/+qLfgkxl9J8 X-Received: by 2002:a05:6402:b87:: with SMTP id cf7mr7882297edb.137.1603552989480; Sat, 24 Oct 2020 08:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603552989; cv=none; d=google.com; s=arc-20160816; b=DwGXYAM66LPBhRi4VNEWUmt/xAgpuZml40KEGNzfk6IcmRevdg68bJNuD6i1q0A171 hsS3w8fryCxR1Xq6yGem2nlxx82hvVrkHSU13Ga81ZlKx95A2tLdWd2BzFybuS5P4F8I g0s3YZCFJQgc8BxaFKpn5SJZq1R3wmCEjpqO4mbjFF4BJYiv05dAkV75U9Itll8d3q28 I6c5Se7O1VAFVZSi/MwCTDx0AlLNd6awg+nU7vB2DAJFK49I7WqALf2F+xBSQWi6fXsz V36zcsCi+tASvj6d4b3Z1pHfGgv/3mnHcaa7KAq2y5zQpi8iipKCOKWLQmFlZ5Xtvxsq mtwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=RDRwq8+3VpThffYJtXt/v2rYH+3Mm1/lRXG8WvQsfX8=; b=Z7c7dejAm9xRsukUhQyCBDm6mrjirgKE65lfBnI7pMgN7hcr441XuZwJaft7JjWqou hStyEhj1Ia7bD2UshhyvRRPAPDEqZgWdvW0nGglANmN4/y2YBHoYG4CtUqZ2Ny3B2rAs 02hx5kthpz32464hGlaO1jXwTlPenUpciTwyHsA2IzdI5Og7Ya0CLY12S5mw4pfJlnwA dtwsPfHYL38qOg3gl23KxE0Ir2Qvfi/mew5s67fYxQCrEv0ZqNicOwIxkBOBJLNqofX0 N0pjRgI+KCBfPch0gRDcQE7/kgVb7SnvZgoFc8EmRJ5Chz9qQZrN4WKdNVnlXoW8necy wIHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si3610481edn.216.2020.10.24.08.22.46; Sat, 24 Oct 2020 08:23:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761770AbgJXNiv (ORCPT + 99 others); Sat, 24 Oct 2020 09:38:51 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:34178 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761769AbgJXNiu (ORCPT ); Sat, 24 Oct 2020 09:38:50 -0400 Received: from mail-wm1-f69.google.com ([209.85.128.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kWJku-0000ri-NB for linux-ext4@vger.kernel.org; Sat, 24 Oct 2020 13:38:48 +0000 Received: by mail-wm1-f69.google.com with SMTP id s25so1610789wmj.7 for ; Sat, 24 Oct 2020 06:38:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RDRwq8+3VpThffYJtXt/v2rYH+3Mm1/lRXG8WvQsfX8=; b=U8GMAvPyZc9xWkEbJI72fdn4O+sC4nx9KKIyEUIJW9zkvV0s1bBlGr3XP9/+o0tfni sS9dLVOlUN77rfQnjB/j2w6vyQK77Gq27H7oyqPTV0Gvzrjr/mJFpirIWxcAZWQB4HZY RSZkCxzTGoXmU2gnpQCS6HsHRfgcC79+Dyi6AbUWW7lISP7JruwKlMHqapR8MPiOh5K1 abQQQh++UHG1+IIdjl6NRuE2t2nNw7VIvE8KH/Xi/doaOTEJxmy0NM1Mdr9pflWFVHwE LVujS3JZu8IZGV0hvLWGCrJQFvPdbT+9XMujQ0R6A1STsT1B+/oyL0JUQfwgQFxLHPHl ASjQ== X-Gm-Message-State: AOAM533hPkgofKSB75iXnsDhe2/Lvn/586azAniIJJI15XeOPQ9S/9rj 0euos24evhr3KIbtww9yU+MRoNJHIzjMSSgWHQknbwEd4TGB5Ig5kQnACbsDwAyiUofkK+tVm8I FTtFq+USvlLX6O9Zy2nWTk+DqBEIIZVjap9T3nKs= X-Received: by 2002:a1c:9695:: with SMTP id y143mr6623607wmd.146.1603546728001; Sat, 24 Oct 2020 06:38:48 -0700 (PDT) X-Received: by 2002:a1c:9695:: with SMTP id y143mr6623590wmd.146.1603546727785; Sat, 24 Oct 2020 06:38:47 -0700 (PDT) Received: from localhost (host-79-33-123-6.retail.telecomitalia.it. [79.33.123.6]) by smtp.gmail.com with ESMTPSA id m12sm9937844wmi.33.2020.10.24.06.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Oct 2020 06:38:47 -0700 (PDT) Date: Sat, 24 Oct 2020 15:38:46 +0200 From: Andrea Righi To: Harshad Shirwadkar Cc: Theodore Ts'o , Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: swap file broken with ext4 fast-commit Message-ID: <20201024133846.GA33750@xps-13-7390> References: <20201024131333.GA32124@xps-13-7390> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201024131333.GA32124@xps-13-7390> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat, Oct 24, 2020 at 03:13:37PM +0200, Andrea Righi wrote: > I'm getting the following error if I try to create and activate a swap > file defined on an ext4 filesystem: > > [ 34.406479] swapon: file is not committed > > The swap file is created in the root filesystem (ext4 mounted with the > following options): > > $ grep " / " /proc/mounts > /dev/vda1 / ext4 rw,relatime 0 0 > > No matter how long I wait or how many times I run sync, I'm still > getting the same error and the swap file is never activated. > > A git bisect shows that this issue has been introduced by the following > commit: > > aa75f4d3daae ("ext4: main fast-commit commit path") > > Simple test case to reproduce the problem: > > # fallocate -l 8G /swapfile > # chmod 0600 /swapfile > # mkswap /swapfile > # swapon /swapfile > > Maybe we're missing to mark the inode as clean somewhere, even if the > transation is committed to the journal? I think I see the problem. There's something wrong in ext4_inode_datasync_dirty(), it looks like the logic to check if the inode is dirty is quite the opposite. I'll test and send a patch soon. -Andrea