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 A082235C1BA for ; Tue, 13 Jan 2026 08:20:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768292443; cv=none; b=QOH2ulLGyyZgChiB7+PbmOoKmVmcxUN0j++IFzKfpDoWphLWv7MbtFO7L3dWYH+dl9mcDo6GvucVlz9BPF5trVZSmgbBZDLzEkycMpTq0MUl9Q0F2JoLMgZT1JHtb8YliHlkmRH7A/rdCN/wFLPKut9P0IJ75gCp3hZ7FvJ86RU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768292443; c=relaxed/simple; bh=ItblKe1dpBNtiNh/o2vkCVVVDmYDKNW5eds1PrHJgOY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g//4ZzswElbvB69XaW2aeK50x2vqBl9sWcpPDHk4yiH16DplzrRPK3BZiphONwjgEMYJ22+55AQmwtSUMXGDtVtmEPrUwZegIeVvlsyEUcOi2Fhxlnf35d3j6i93aSjQTzmw+OQA0iWLdGRiQtBRM1yCqtMr5pjFs9R4HR1AHMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (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 DEA34227AA8; Tue, 13 Jan 2026 09:20:39 +0100 (CET) Date: Tue, 13 Jan 2026 09:20:39 +0100 From: Christoph Hellwig To: Andrey Albershteyn Cc: fsverity@lists.linux.dev, linux-xfs@vger.kernel.org, ebiggers@kernel.org, linux-fsdevel@vger.kernel.org, aalbersh@kernel.org, djwong@kernel.org, david@fromorbit.com, hch@lst.de Subject: Re: [PATCH v2 10/22] xfs: disable direct read path for fs-verity files Message-ID: <20260113082039.GE30809@lst.de> References: <6rsqoybslyv6cguyk4usq5k2noetozrj3k67ygv5ko5fc57lvn@zv67vcnds7ts> Precedence: bulk X-Mailing-List: fsverity@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6rsqoybslyv6cguyk4usq5k2noetozrj3k67ygv5ko5fc57lvn@zv67vcnds7ts> User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Jan 12, 2026 at 03:51:03PM +0100, Andrey Albershteyn wrote: > if (IS_DAX(inode)) > ret = xfs_file_dax_read(iocb, to); > - else if (iocb->ki_flags & IOCB_DIRECT) > + else if ((iocb->ki_flags & IOCB_DIRECT) && !fsverity_active(inode)) > ret = xfs_file_dio_read(iocb, to); > - else > + else { > + /* > + * In case fs-verity is enabled, we also fallback to the > + * buffered read from the direct read path. Therefore, > + * IOCB_DIRECT is set and need to be cleared (see > + * generic_file_read_iter()) > + */ > + iocb->ki_flags &= ~IOCB_DIRECT; > ret = xfs_file_buffered_read(iocb, to); > + } I think this might actuall be easier as: if (fsverity_active(inode)) iocb->ki_flags &= ~IOCB_DIRECT; ...