From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6E3063AB; Thu, 28 Dec 2023 07:12:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 8131768B05; Thu, 28 Dec 2023 08:12:06 +0100 (CET) Date: Thu, 28 Dec 2023 08:12:06 +0100 From: Christoph Hellwig To: Bart Van Assche Cc: "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jens Axboe , Christoph Hellwig , Daejun Park , Kanchan Joshi , Alexander Viro , Christian Brauner , Jeff Layton , Chuck Lever Subject: Re: [PATCH v8 06/19] block, fs: Propagate write hints to the block device inode Message-ID: <20231228071206.GA13770@lst.de> References: <20231219000815.2739120-1-bvanassche@acm.org> <20231219000815.2739120-7-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-fsdevel@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: <20231219000815.2739120-7-bvanassche@acm.org> User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Dec 18, 2023 at 04:07:39PM -0800, Bart Van Assche wrote: > Write hints applied with F_SET_RW_HINT on a block device affect the > shmem inode only. Propagate these hints to the block device inode > because that is the inode used when writing back dirty pages. What shmem inode? > @@ -317,6 +318,9 @@ static long fcntl_set_rw_hint(struct file *file, unsigned int cmd, > > inode_lock(inode); > inode->i_write_hint = hint; > + apply_whint = inode->i_fop->apply_whint; > + if (apply_whint) > + apply_whint(file, hint); Setting the hint in file->f_mapping->inode is the right thing here, not adding a method.