Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7639995rdb; Thu, 4 Jan 2024 03:06:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHOtOrJy8KDiJ3WVSE2NOigHcnN/475RCGpNht50hx89E711QrIxw5XkLeMTS43bNFta1Z X-Received: by 2002:a05:620a:e19:b0:781:cead:1507 with SMTP id y25-20020a05620a0e1900b00781cead1507mr334287qkm.19.1704366413757; Thu, 04 Jan 2024 03:06:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704366413; cv=none; d=google.com; s=arc-20160816; b=h0oViPBMD645HOcxChnxlvpstJxKObn93QpDUF8+BURcJS/2hyxXJG3xqNbt/PZygo /AGgRz7AcIaVOl1A4rN8zcRdeQDulntpAnjWKZJdTuHhXWcHjnADpHAHrc8ISGatNw4W 2rj1fMHl8A7XaBWH1sz+OTkZ2ZFeAP/uY2DDK95WGjL6UyWaBaY9NwodFK3OZZ3WDYAZ ZYr66PlLxMbv6I8km2T/J6/qvkQIaGZ7POZwiIX3S5KkgcEN5UWIelz0+7wKEFN00jpb JDqxWyclPSgKUcaHEnEVMuo60cNRVEpT7StU3TbOPAwAS44AZ7Wter5iMBEu36HLVAOV 0Ohw== ARC-Message-Signature: i=1; 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=z1IF2wF6kwKN1+MUgbe4SPYXy6b3fZ2jaH8f6LqUCAU=; fh=lRoHO01WXmD+1Zfnj4BTlym0cFAChcwmtdI2OaHOwSY=; b=WFhx6wSYVS1Q8ZaSWxZrzWldtQ7V5gMdG74Y4teAIuHRGYC71rU1hhZ/NcQuVLJf28 rszHOSIfFqvYV91nVbjXjwgqTdjMv6KxS9biTKsESN3hkY6Nrr7gxfOD8CYy7eyoC2YC Yvxjs35hkXx/bibeK4OuOKWMp3zWsk2DidOdHXYH6DyjxvB8lcHv2dXrREa1hD1Bsedm l72RGZQrqXXXk5EHYqoYl9cWK95ec9DjKqA/ILGL7MPPcLUSPjlH8QbHbj0Lfapks804 HMQzFt54P9znVDk9E3vFZL+kN5uD0clVlovW86HRRLcXMUi8ouD5FSijzyG7KiXgUjs5 8PbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ed15D+gF; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ed15D+gF; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4+bounces-677-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-677-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u16-20020a05620a0c5000b007818924be4esi14516259qki.614.2024.01.04.03.06.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 03:06:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-677-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ed15D+gF; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ed15D+gF; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4+bounces-677-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-677-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 74A161C238C8 for ; Thu, 4 Jan 2024 11:06:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42E7421101; Thu, 4 Jan 2024 11:06:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="ed15D+gF"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="d34IMjGx"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="ed15D+gF"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="d34IMjGx" X-Original-To: linux-ext4@vger.kernel.org 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 2129320DDF; Thu, 4 Jan 2024 11:06:33 +0000 (UTC) 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 [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 B485A21DCD; Thu, 4 Jan 2024 11:06:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1704366391; 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=z1IF2wF6kwKN1+MUgbe4SPYXy6b3fZ2jaH8f6LqUCAU=; b=ed15D+gFpwqrClSMscoZXuYlaFPD5SRis5efpvHvwOFtmLvhKDT31k32lM3uAx1eRSCBKC hGWnOxrPK5+SF+IRzKDbnKvvUPebbuYgLoeLF6ITUFuGcKaIsQsfKLkUxjC5o8/NojVblh G6DHXJd4vsjP8BrQ30igQ2HAR83E4MQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1704366391; 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=z1IF2wF6kwKN1+MUgbe4SPYXy6b3fZ2jaH8f6LqUCAU=; b=d34IMjGxeazCejiFudncTLHw7CMgLsIjxWQRRZJ2xAsFnDqQbVIvRRVRb/OJinOkDWu2zI 4PZWPGF65Myy4bAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1704366391; 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=z1IF2wF6kwKN1+MUgbe4SPYXy6b3fZ2jaH8f6LqUCAU=; b=ed15D+gFpwqrClSMscoZXuYlaFPD5SRis5efpvHvwOFtmLvhKDT31k32lM3uAx1eRSCBKC hGWnOxrPK5+SF+IRzKDbnKvvUPebbuYgLoeLF6ITUFuGcKaIsQsfKLkUxjC5o8/NojVblh G6DHXJd4vsjP8BrQ30igQ2HAR83E4MQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1704366391; 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=z1IF2wF6kwKN1+MUgbe4SPYXy6b3fZ2jaH8f6LqUCAU=; b=d34IMjGxeazCejiFudncTLHw7CMgLsIjxWQRRZJ2xAsFnDqQbVIvRRVRb/OJinOkDWu2zI 4PZWPGF65Myy4bAA== 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 A20CE13722; Thu, 4 Jan 2024 11:06:31 +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 8zOOJzeRlmXyfQAAD6G6ig (envelope-from ); Thu, 04 Jan 2024 11:06:31 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 3DC50A07EF; Thu, 4 Jan 2024 12:06:31 +0100 (CET) Date: Thu, 4 Jan 2024 12:06:31 +0100 From: Jan Kara To: Yu Kuai Cc: axboe@kernel.dk, roger.pau@citrix.com, colyli@suse.de, kent.overstreet@gmail.com, joern@lazybastard.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, sth@linux.ibm.com, hoeppner@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, jejb@linux.ibm.com, martin.petersen@oracle.com, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, viro@zeniv.linux.org.uk, brauner@kernel.org, nico@fluxnic.net, xiang@kernel.org, chao@kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.com, konishi.ryusuke@gmail.com, willy@infradead.org, akpm@linux-foundation.org, hare@suse.de, p.raghav@samsung.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-nilfs@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: Re: [PATCH RFC v3 for-6.8/block 02/17] xen/blkback: use bdev api in xen_update_blkif_status() Message-ID: <20240104110631.3vspsvxbbvcpdqdu@quack3> References: <20231221085712.1766333-1-yukuai1@huaweicloud.com> <20231221085712.1766333-3-yukuai1@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-ext4@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: <20231221085712.1766333-3-yukuai1@huaweicloud.com> X-Spam-Level: ** X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=ed15D+gF; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=d34IMjGx X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.50 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_SPAM(0.01)[44.94%]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLhr85cyeg3mfw7iggddtjdkgs)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FROM_HAS_DN(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_HAM_LONG(-1.00)[-1.000]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[48]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:dkim,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[kernel.dk,citrix.com,suse.de,gmail.com,lazybastard.org,bootlin.com,nod.at,ti.com,linux.ibm.com,oracle.com,fb.com,toxicpanda.com,suse.com,zeniv.linux.org.uk,kernel.org,fluxnic.net,mit.edu,dilger.ca,infradead.org,linux-foundation.org,samsung.com,vger.kernel.org,lists.xenproject.org,lists.infradead.org,lists.ozlabs.org,huawei.com]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Score: 0.50 X-Rspamd-Queue-Id: B485A21DCD X-Spam-Flag: NO On Thu 21-12-23 16:56:57, Yu Kuai wrote: > From: Yu Kuai > > Avoid to access bd_inode directly, prepare to remove bd_inode from > block_devcie. > > Signed-off-by: Yu Kuai > --- > drivers/block/xen-blkback/xenbus.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c > index e34219ea2b05..e645afa4af57 100644 > --- a/drivers/block/xen-blkback/xenbus.c > +++ b/drivers/block/xen-blkback/xenbus.c > @@ -104,8 +104,7 @@ static void xen_update_blkif_status(struct xen_blkif *blkif) > xenbus_dev_error(blkif->be->dev, err, "block flush"); > return; > } > - invalidate_inode_pages2( > - blkif->vbd.bdev_handle->bdev->bd_inode->i_mapping); > + invalidate_bdev(blkif->vbd.bdev_handle->bdev); This function uses invalidate_inode_pages2() while invalidate_bdev() ends up using mapping_try_invalidate() and there are subtle behavioral differences between these two (for example invalidate_inode_pages2() tries to clean dirty pages using the ->launder_folio method). So I think you'll need helper like invalidate_bdev2() for this. Honza -- Jan Kara SUSE Labs, CR