Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp116719lqt; Mon, 18 Mar 2024 03:15:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7CNSD6CfpGc2PPr3bO+9HNXf7G18z4w0BqOIE7VbY+1xRX82I3swYlKcgJxjFbTDWb8zFIIh9c1E/TntJ0KvdmwI0W7wVtFuuPrcs5g== X-Google-Smtp-Source: AGHT+IG2CBG/pSxPJ3rxFIu9D0acEMwqhpcgG09lRbJ8s1Dh2AoT7xQAsEIxPdquE7hhInZwYTrf X-Received: by 2002:a4a:351a:0:b0:5a1:bb9d:56a7 with SMTP id l26-20020a4a351a000000b005a1bb9d56a7mr9324280ooa.8.1710756929645; Mon, 18 Mar 2024 03:15:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710756929; cv=pass; d=google.com; s=arc-20160816; b=jL8GEJ6fZlxsewqHZSurkUAGSMkdKqp4kFQk/yMa45ipMAMqPI8vE0ssUORAqRjlre mTOIPYm5qBdboDkPDZxg68HnQqSKE3auKuLMEWSxQZ1ejxi/hbQ8qxOBO7E++yllljdX VDmOhCLYdi7MUwlzC4VUxVNDPRI6e7bY7ctx9qEdahaINfMHRrQKLYNtbv9uVWz+ZwgL gnoSATc/5/9Bf6Ur6xjoJXaWaEBYZ0Jk+ZLrFOI6t5OCwVhUzPxiImfm03x6DBcDmK3r l+FZVv9YCKEHvNosR1x6Ve8qU41VCAkLSb5yqrE7w33bUqO4CRt8oc4XQpKniwA/MOjF yh/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=sXeXlxOahp88uM7sj5XyseV2tk62A3EuPgcosS5F4ow=; fh=rgHGO1Lz9Z7CYNs9UqKhvERHbtjXZlEakuzM/dupk2o=; b=ypVKj3KvP60nqplzWDcJwhzpVROMeurkhtWjes4/3cPbV8z/d4j4SBYREE/9CMp3fY ns152hk7iCD/mI6brp8Nb3CpbLuzp6nOgkGU+5mS7c1FHWjcZhq3NPn1EsodQkHzI0KE hP4KIhgCTI+p0Koy+I20Quf579mT6AXiW8i4gleFdLGYQNxZMeEScjbyHhWozYvQTvoj TeLZ1pdAfQnpe9eyP4rjszSqeI/9WjlNTI91YUVdr5kLzlC4e6svhrADZ+naZ//Z9tF8 i5kOZ0ZkjwPdQ5UmMdAc4J4SshQt1ANp0SPf24W4+IGWSNQ+PXQAo/XaZbSstOPZmAqz A/Mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=2dw1UmQt; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=2dw1UmQt; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=3z0xrg9c; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-105973-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105973-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a12-20020a63e40c000000b005b95ee3edc6si7828798pgi.628.2024.03.18.03.15.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 03:15:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105973-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=2dw1UmQt; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=2dw1UmQt; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=3z0xrg9c; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-105973-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105973-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 480A4281362 for ; Mon, 18 Mar 2024 10:15:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14A7A2E40D; Mon, 18 Mar 2024 10:12:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="2dw1UmQt"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="3z0xrg9c"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="2dw1UmQt"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="3z0xrg9c" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4911C2C87A; Mon, 18 Mar 2024 10:12:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710756746; cv=none; b=SA1AGNsuVXfDPErOhRUb7lKnR80vfZFydoLebAKofCGKrrRCNR2CSaGw2QOuKlHGmO5KHReE4fgNsmOMvxDwpyCpxULZEMyUa32FmvKTHeaUZzq7FeMhYZKDZ3Y69wzxXwiO+bfY8tkr+6p2FG5tqLTucrtIW6b5QPP0FrN4qT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710756746; c=relaxed/simple; bh=bErza8r5vX4TMpVnLgnjWknUlsjPH6b+8522Wz2lM54=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q3dXTk1abGbsMqIhBP27rFTNnI1cZIMQB9t+RiIugt+6JNlZrw2R+hjSCmSvWmNMasnb17T/R2QmhSZydPLKSYuUNi54KHMg9t3fKDZdwXGiIjDoCFQGwAQbLQnpDdFwgYEOu297xSf2eW/RCW3Vgri2zgaHeXdUSJvZOR+2qiU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=2dw1UmQt; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=3z0xrg9c; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=2dw1UmQt; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=3z0xrg9c; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 880CF348C3; Mon, 18 Mar 2024 10:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1710756742; 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=sXeXlxOahp88uM7sj5XyseV2tk62A3EuPgcosS5F4ow=; b=2dw1UmQtc7AIvk4NmyXmy1gMrw9H9l9ObhFnI29e+XZf2iJ1LNr31QYMlOjjLYr2rvJQog hQDALrZKeXlSgW+Ppj1yVUnpeu49nv5xqQiKyIpbFo/ZlyDfTie+PU9R4aXQNXhYDEd9T9 Bhif0CoMg7CxytzI/n/+H2WaULS4Wjs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1710756742; 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=sXeXlxOahp88uM7sj5XyseV2tk62A3EuPgcosS5F4ow=; b=3z0xrg9c5b0ltCbZEyJT3buHnc54X0K8YJjSdemSfbP4dr6iISxl8z2aR0atSZuDvo8JbP Uw2aoGrpk1cUTuCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1710756742; 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=sXeXlxOahp88uM7sj5XyseV2tk62A3EuPgcosS5F4ow=; b=2dw1UmQtc7AIvk4NmyXmy1gMrw9H9l9ObhFnI29e+XZf2iJ1LNr31QYMlOjjLYr2rvJQog hQDALrZKeXlSgW+Ppj1yVUnpeu49nv5xqQiKyIpbFo/ZlyDfTie+PU9R4aXQNXhYDEd9T9 Bhif0CoMg7CxytzI/n/+H2WaULS4Wjs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1710756742; 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=sXeXlxOahp88uM7sj5XyseV2tk62A3EuPgcosS5F4ow=; b=3z0xrg9c5b0ltCbZEyJT3buHnc54X0K8YJjSdemSfbP4dr6iISxl8z2aR0atSZuDvo8JbP Uw2aoGrpk1cUTuCg== 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 7D8C61389C; Mon, 18 Mar 2024 10:12:22 +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 uACdHoYT+GXkWwAAD6G6ig (envelope-from ); Mon, 18 Mar 2024 10:12:22 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 2043CA07D9; Mon, 18 Mar 2024 11:12:22 +0100 (CET) Date: Mon, 18 Mar 2024 11:12:22 +0100 From: Jan Kara To: Matthew Wilcox Cc: cheung wall , Alexander Viro , Christian Brauner , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: WARNING in mark_buffer_dirty Message-ID: <20240318101222.sbh52pa4mmwidzyw@quack3> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Score: 7.91 X-Spamd-Result: default: False [7.91 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-0.48)[79.55%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(3.00)[0.999]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_SPAM_LONG(3.50)[1.000]; RCPT_COUNT_SEVEN(0.00)[7]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[gmail.com,zeniv.linux.org.uk,kernel.org,suse.cz,vger.kernel.org]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Level: ******* Authentication-Results: smtp-out1.suse.de; none X-Spam-Flag: NO On Sat 16-03-24 04:54:10, Matthew Wilcox wrote: > > This might be an iomap bug, so adding Christoph & Darrick. > > On Sat, Mar 16, 2024 at 12:29:36PM +0800, cheung wall wrote: > > HEAD commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a (tag: v6.7) > > WARNING: CPU: 0 PID: 2920 at fs/buffer.c:1176 > > mark_buffer_dirty+0x232/0x290 > > This is WARN_ON_ONCE(!buffer_uptodate(bh)), so we're trying to mark a > buffer dirty when that buffer is not uptodate. > > > RIP: 0010:mark_buffer_dirty+0x232/0x290 > > fs/buffer.c:1176 > > Call Trace: > > > > __block_commit_write+0xe9/0x200 > > fs/buffer.c:2191 > > ... but line 2190 and 91 are: > > set_buffer_uptodate(bh); > mark_buffer_dirty(bh); > > and the folio is locked. So how do we clear the uptodate flag on the > buffer without the folio locked? Given this happens on block device page cache, I can imagine there's someone operating on the cache directly using buffer heads without locking the page. Filesystems do this all the time. I don't see the reproducer doing anything like that but who knows... Honza > > block_write_end+0xb1/0x1f0 > > fs/buffer.c:2267 > > iomap_write_end+0x461/0x8c0 > > fs/iomap/buffered-io.c:857 > > iomap_write_iter > > fs/iomap/buffered-io.c:938 > > [inline] > > iomap_file_buffered_write+0x4eb/0x800 > > fs/iomap/buffered-io.c:987 > > blkdev_buffered_write > > block/fops.c:646 > > [inline] > > blkdev_write_iter+0x4ae/0xa40 > > block/fops.c:696 > > call_write_iter > -- Jan Kara SUSE Labs, CR