Re: floppy regression from "[PATCH] fix floppy.c to store correct..."

From: Andrew Morton
Date: Tue Nov 22 2005 - 02:31:28 EST


Jon Masters <jonathan@xxxxxxxxxxxxxx> wrote:
>
> - if (!UDRS->fd_ref)
> + if (!UDRS->fd_ref) {
> + opened_bdev[drive]->bd_disk->policy = 0;
> opened_bdev[drive] = NULL;
> + }
> floppy_release_irq_and_dma();
> +
> up(&open_lock);
> return 0;
> }
> @@ -3714,6 +3719,13 @@
> USETF(FD_VERIFY);
> }
>
> + /* set underlying gendisk policy to reflect device ro/rw status */
> + if (UDRS->first_read_date && !(UTESTF(FD_DISK_WRITABLE))) {
> + inode->i_bdev->bd_disk->policy = 1;
> + } else {
> + inode->i_bdev->bd_disk->policy = 0;
> + }
> +

That still does the wrong thing. Put in a write-protected floppy, try to
write to it and it says -EROFS. Then pop the WP switch and try to write to
it again and it wrongly claims EPERM. A second attempt to write will
succeed.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/