Thread (108 messages) 108 messages, 9 authors, 2023-10-02

Re: [PATCH 02/29] block: Use bdev_open_by_dev() in blkdev_open()

From: Jan Kara <jack@suse.cz>
Date: 2023-08-25 09:46:02
Also in: linux-fsdevel

On Fri 25-08-23 03:28:26, Al Viro wrote:
On Wed, Aug 23, 2023 at 12:48:13PM +0200, Jan Kara wrote:
quoted
diff --git a/block/ioctl.c b/block/ioctl.c
index 648670ddb164..54c1e2f71031 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -582,7 +582,8 @@ long blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 {
 	struct block_device *bdev = I_BDEV(file->f_mapping->host);
 	void __user *argp = (void __user *)arg;
-	blk_mode_t mode = file_to_blk_mode(file);
+	struct bdev_handle *bdev_handle = file->private_data;
+	blk_mode_t mode = bdev_handle->mode;
 	int ret;
 
 	switch (cmd) {
	Still the same bug as in v2 - you are missing the effects of
fcntl(2) setting/clearing O_NDELAY and sd_ioctl() is sensitive to that.
Argh, indeed you are correct. I forgot about fcntl(2) modifying
file->f_flags. Attached is a version of the patch that I'm currently
testing.

								Honza

-- 
Jan Kara [off-list ref]
SUSE Labs, CR

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help