From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (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 8E98D4968FC for ; Thu, 8 Oct 2026 12:27:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791462478; cv=none; b=fjBZgY7GzhabMbrmfsPFssHGzXGYU4HXTsVqNdhIHCX4Ji2IOxEvdJmVV6r2c6tbL/SUc2iSqQZyMdlblyEVUj0brkUwQ7xhH010fjOHJ4t0RW/6STlnHdZpb2olNWrMU7NUwgjqX2bkatavNMQYfSssCqdyl4xfCeECppddp9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791462478; c=relaxed/simple; bh=M/of0yKyhsge6MIBInUspqDhJmPuNOVFyiktJawrHXk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=J/5FCwPKYA5LlBOCFDTNHKNZ2qWiBSqCWCSk52FCgb9Jx0X/TFSYe3KvBPxDIaK1ZquqCQa2hyr9g5/T58lOlJ5nBEkQTOPWI0Jb3Rt8y19HMDn/7XRrYPJBqQx4czngMfidqjnHZTxPaD1eDaXE684pi0wD5385yA0VoRxNIe0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=tdC5+MT+; arc=none smtp.client-ip=203.254.224.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="tdC5+MT+" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20261008122753epoutp026daf443a936e5b2d698fea5a8b73e422~cjaDGlJeM0521205212epoutp02Z for ; Thu, 8 Oct 2026 12:27:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20261008122753epoutp026daf443a936e5b2d698fea5a8b73e422~cjaDGlJeM0521205212epoutp02Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1791462473; bh=y3JROMvSkErlghFufMEpz2e3fgBQWeAkOo4JhswqA7k=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=tdC5+MT+GmAi5muBRq1BT1yN1ZKyFBL9HVTHiJoMUk9qir3KHpRlhz35ERD8YB6Bl i1eJ514gd7g1gNeb0KlrladiC9kKg0NHCB+yBiTYgiBHVNFGcUFtxIU50PqOf5+JRY f9jIGFX133rc42c6pXTmJz1rl62OYAb4OJmJKBEI= Received: from epsnrtp03.localdomain (unknown [182.195.42.155]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPS id 20261008122752epcas5p3d0e2b9158c0268ad04675e87ce26f1a2~cjaCjkMAU1506315063epcas5p3z; Thu, 8 Oct 2026 12:27:52 +0000 (GMT) Received: from epcas5p1.samsung.com (unknown [182.195.38.93]) by epsnrtp03.localdomain (Postfix) with ESMTP id 4j0q5M5zGqz3hhT3; Thu, 8 Oct 2026 12:27:51 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20261008122751epcas5p1c1717e88968c87ac8cd3f6f7cd53fd94~cjaBJv_6d1842018420epcas5p1H; Thu, 8 Oct 2026 12:27:51 +0000 (GMT) Received: from [107.122.10.194] (unknown [107.122.10.194]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20261008122747epsmtip1643989c6f636e89fda3b56fc37de2645~cjZ9_NBhB1436814368epsmtip1X; Thu, 8 Oct 2026 12:27:47 +0000 (GMT) Message-ID: Date: Thu, 8 Oct 2026 17:57:47 +0530 Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 05/13] block: add dma-buf support for raw bdev To: Pavel Begunkov , linux-block@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, Christoph Hellwig , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Keith Busch , Sagi Grimberg , Alexander Viro , Christian Brauner , Jan Kara , Andrew Morton , Jens Axboe , Nitesh Shetty , Kanchan Joshi , Mike Snitzer , Mikulas Patocka , Benjamin Marzinski , dm-devel@lists.linux.dev Content-Language: en-US From: Anuj Gupta/Anuj Gupta In-Reply-To: Content-Transfer-Encoding: 7bit X-CMS-MailID: 20261008122751epcas5p1c1717e88968c87ac8cd3f6f7cd53fd94 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20261007014324epcas5p2a7f3b03f118c9a1d1c633fe839ed1e46 References: On 10/7/2026 7:12 AM, Pavel Begunkov wrote: > +static int blkdev_init_dma_buf_io_ctx(struct file *file, > + struct dma_buf_io_ctx *ctx) > +{ > + struct block_device *bdev = file_bdev(file); > + struct gendisk *disk = bdev->bd_disk; > + > + if (!(file->f_flags & O_DIRECT)) > + return -EINVAL; > + if (!disk->fops->init_dma_buf_io_ctx) > + return -EOPNOTSUPP; dma-buf doesn't work with PI: bi_dmabuf_map aliases bi_io_vec, and blk_integrity_iterate() walks it as bvecs to generate/verify the checksum. rw-dmabuf liburing test hangs on a PI enabled NVMe. Something like below is needed: diff --git a/block/blk-mq.c b/block/blk-mq.c index e929f94b25c7..1b7f8cbbda8b 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3150,6 +3150,12 @@ void blk_mq_submit_bio(struct bio *bio) goto queue_exit; } + if (unlikely(op_is_dmabuf(bio->bi_opf) && + bdev_has_integrity_csum(bio->bi_bdev))) { + bio_endio_status(bio, BLK_STS_NOTSUPP); + goto queue_exit; + } + if ((bio->bi_opf & REQ_POLLED) && !blk_mq_can_poll(q)) { bio_endio_status(bio, BLK_STS_NOTSUPP); goto queue_exit; diff --git a/block/fops.c b/block/fops.c index e9da48ab73be..6c6700df943c 100644 --- a/block/fops.c +++ b/block/fops.c @@ -976,6 +976,8 @@ static int blkdev_init_dma_buf_io_ctx(struct file *file, return -EINVAL; if (!disk->fops->init_dma_buf_io_ctx) return -EOPNOTSUPP; + if (bdev_has_integrity_csum(bdev)) + return -EOPNOTSUPP; return disk->fops->init_dma_buf_io_ctx(bdev, ctx); }