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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5D5EC369AB for ; Tue, 15 Apr 2025 11:23:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A64B32801D4; Tue, 15 Apr 2025 07:23:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9EBB12800BD; Tue, 15 Apr 2025 07:23:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8172D2801D4; Tue, 15 Apr 2025 07:23:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5ED4C2800BD for ; Tue, 15 Apr 2025 07:23:08 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A13E81CD4AE for ; Tue, 15 Apr 2025 11:23:08 +0000 (UTC) X-FDA: 83336041656.06.3F584FA Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf04.hostedemail.com (Postfix) with ESMTP id 67AE840007 for ; Tue, 15 Apr 2025 11:23:06 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Ay7syMJi; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=PHfYBDIb; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Ay7syMJi; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=PHfYBDIb; dmarc=none; spf=pass (imf04.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744716186; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+wix4v6LrgRo48XvjMawpOKewYVjZzdakpjsbPdduIU=; b=XSMNR1DxMntvrOIheJfGpa89+noFq5pr4/Tzz2+gGge4I5sF3qZSwWy0xAHmTuqcYYalKN h5f/SMBlRhwz4zh8f/nRq8f8k+DqW8ctZP8n7Jqu65yvyQOCV4pEnihpPPDiJ6F1WtOhtv uOnAVVEDv/VqM4NxkrePoVwCTGozdaA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Ay7syMJi; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=PHfYBDIb; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Ay7syMJi; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=PHfYBDIb; dmarc=none; spf=pass (imf04.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1744716186; a=rsa-sha256; cv=none; b=2NI7t6Fqa0banBgdbWi4CGZQl9NBRkAHF5XyH0zMryAms6pWkh8EdWl+XDpTjHthtV5omH axAeEp9z+mIqySvq6zGNf1YTIuHjlM1H0KuPjPkCAQcDvF3Cnp7dLOF0PIMaV58u5ZfaX3 ipGYerN3+Pt42XuMbLwlXm6Ht2E8k0s= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B3EBF21165; Tue, 15 Apr 2025 11:23:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1744716184; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+wix4v6LrgRo48XvjMawpOKewYVjZzdakpjsbPdduIU=; b=Ay7syMJi3uN8fO0/Rghxxu+CSIDVhV0yAaSo/oZ+H0bGf0mJ4BWWAvFdowoBjrZi3tDSkQ 1BJA+4/p9GKx10rXcvKtLfT7OTodbQDrdv7+rgowotAKTLr/FC0cHUUGIMCQcM7JYk+Tcu mvWib2kLaBXG6vDceJ1/OBu2tUGw3HM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1744716184; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+wix4v6LrgRo48XvjMawpOKewYVjZzdakpjsbPdduIU=; b=PHfYBDIbKUsp7yzDxVlmKooxEc2OZaueQiPf7f3JZ91eZT4m4ZwjUQmPRd0iCY+ZLzGwMy rVtWoVOLDIubZrAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1744716184; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+wix4v6LrgRo48XvjMawpOKewYVjZzdakpjsbPdduIU=; b=Ay7syMJi3uN8fO0/Rghxxu+CSIDVhV0yAaSo/oZ+H0bGf0mJ4BWWAvFdowoBjrZi3tDSkQ 1BJA+4/p9GKx10rXcvKtLfT7OTodbQDrdv7+rgowotAKTLr/FC0cHUUGIMCQcM7JYk+Tcu mvWib2kLaBXG6vDceJ1/OBu2tUGw3HM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1744716184; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+wix4v6LrgRo48XvjMawpOKewYVjZzdakpjsbPdduIU=; b=PHfYBDIbKUsp7yzDxVlmKooxEc2OZaueQiPf7f3JZ91eZT4m4ZwjUQmPRd0iCY+ZLzGwMy rVtWoVOLDIubZrAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A6DAB137A5; Tue, 15 Apr 2025 11:23:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id hOm7KJhB/meqewAAD6G6ig (envelope-from ); Tue, 15 Apr 2025 11:23:04 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 55608A0947; Tue, 15 Apr 2025 13:23:00 +0200 (CEST) Date: Tue, 15 Apr 2025 13:23:00 +0200 From: Jan Kara To: Luis Chamberlain Cc: Jan Kara , brauner@kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, riel@surriel.com, dave@stgolabs.net, willy@infradead.org, hannes@cmpxchg.org, oliver.sang@intel.com, david@redhat.com, axboe@kernel.dk, hare@suse.de, david@fromorbit.com, djwong@kernel.org, ritesh.list@gmail.com, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, gost.dev@samsung.com, p.raghav@samsung.com, da.gomez@samsung.com, syzbot+f3c6fda1297c748a7076@syzkaller.appspotmail.com Subject: Re: [PATCH v2 1/8] migrate: fix skipping metadata buffer heads on migration Message-ID: References: <20250410014945.2140781-1-mcgrof@kernel.org> <20250410014945.2140781-2-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Action: no action X-Stat-Signature: 1o7spq6bwdq13zmz5do5zo4tkdc4s7s6 X-Rspamd-Queue-Id: 67AE840007 X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1744716186-885102 X-HE-Meta: U2FsdGVkX1+qXZJ9lMFWf03OB3KJIZlmzbysi5PkMbWVPLJWzq3gCWPbMYX1Wvw8JR3hEvc9iKsrHR4sDJf9LHzc6Vljg0xggjWks3wTmqFsffSBnR97uXK4sd655Y98VRbzptDu0AvjuqXoM/bHCCRn+iK51E45086F65SB4WuRRl3pXiYQGbK3zGsjMgHVE7gUvLkPnGzpHlvwrjkIT5da0iMF78nsUuP5asxyQUT2GtL3m6wYdWiT/mVe7M0jHfnLG0Sr4e3+UvvKw9GBXDHvDe+05Vd2o/bKgM3YrwpHESRrP0fug+H7VXU+dSVgSRI0xYJTa6648+EjsYtwj51Tq5NWWXbM5YEFi+LLd3TbiCnP2wj9hsrGkHAtoeU94Hejb6WME3M0LxNtYXUyWXNy3C5DWhFBWbM8dceljbFGWGLKt7TLm/vP+NNTB2jryRMaymCVjXKt8Z351QLb9rDzYXCwr3tUWA5L5rWJS7iSLPE/V3alsPxuURzIWOJGKWyxOWO4fjv8gmyitGkNxekISl7ftvrs6lAF6v2imBqqtmi/lxootzdeWl9H3+kuWcuDW1D3Ef1zvoXg/sfUcC/bE0PJ/u5UvOyolOeYPqHXSQ1+gXJW3mZONMa64rJ6vt4dz1p0BFCtlKM5/vAlemzxd15PohYKd6JCiPFiZ2hWO3deqpeSKetKN9hCUpQ6hSgSLqbD1vOm5FLkXeMo8sD4PdaA/LcwCGHki5O5tB5XG7PpQNqgfoKLUpLAv3NIgZaJCV6+xlb68Dsg0eRGxqZxkjCb6TAsyODcdXaBISRtYtJjhFjJ/HI/klLrMumNfEnh8eNgvglyNRZh7QWw8IHRZRSlQpxBHNXKxl0QjWbiqqasn/yYjOoI6wl+ue/vvtDgboBWHgJBTfV2WhUG4V9ykcMlxOhaQ3+tteOaBg3JDWrNnOtqrNi0ZfoHDomRyuYvfdY6gUKsYrf+1RZ NTZ9XETF n3bh4ZyPdYs7UO5zWUpO2Qr+XYgMOMjUnVOpz22dY0+7Rf0UQfiE9aoZonw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon 14-04-25 14:09:44, Luis Chamberlain wrote: > On Thu, Apr 10, 2025 at 02:05:38PM +0200, Jan Kara wrote: > > > @@ -859,12 +862,12 @@ static int __buffer_migrate_folio(struct address_space *mapping, > > > } > > > bh = bh->b_this_page; > > > } while (bh != head); > > > + spin_unlock(&mapping->i_private_lock); > > > > No, you've just broken all simple filesystems (like ext2) with this patch. > > You can reduce the spinlock critical section only after providing > > alternative way to protect them from migration. So this should probably > > happen at the end of the series. > > So you're OK with this spin lock move with the other series in place? Yes. > And so we punt the hard-to-reproduce corruption issue as future work > to do? Yes, I'm not happy about that but I prefer that over putting band aids into that code. Even more so because we don't even understand whether they fix the problem or just make this reproducer stop working... > Becuase the other alternative for now is to just disable > migration for jbd2: > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 1dc09ed5d403..ef1c3ef68877 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -3631,7 +3631,6 @@ static const struct address_space_operations ext4_journalled_aops = { > .bmap = ext4_bmap, > .invalidate_folio = ext4_journalled_invalidate_folio, > .release_folio = ext4_release_folio, > - .migrate_folio = buffer_migrate_folio_norefs, > .is_partially_uptodate = block_is_partially_uptodate, > .error_remove_folio = generic_error_remove_folio, > .swap_activate = ext4_iomap_swap_activate, This will not disable migration for JBD2 buffers. This will just disable migration for files with data journalling. See my other reply for details. Honza -- Jan Kara SUSE Labs, CR