> + /* > + * If this was an exclusive open and writes are blocked > + * we know that we're the ones who blocked them. > + */ > + if (bdev_file->private_data && bdev_writes_blocked(bdev)) This doesn't work because this will unblock BLK_OPEN_RESTRICT_WRITES when the block device has been opened read-only but exclusively, i.e., when e.g., userspace requested read-only access and we use the file as the holder. I have an alternative fix.