On Thu, Dec 09, 2021 at 03:12:33PM +0100, Vladimir Sementsov-Ogievskiy wrote: > Since c7e9d0020361f4308a70cdfd6d5335e273eb8717 > "Revert "floppy: reintroduce O_NDELAY fix"" commit in linux kernel, > floppy drive works bad when opened with O_NONBLOCK: first read may > fail. This cause probing fail and leave error messages in dmesg. So, if > we detect that openedfd is floppy, reopen it without O_NONBLOCK flag. I'd like to a little bit optimize the code in libblkid and reduce number of situations when we call FDGETFDCSTAT ioctl. If I good understand the problem is read() with O_NONBLOCK, right? I'd like to call stat() before FDGETFDCSTAT ioctl to make sure that the file descriptor is really block-device etc. (libmount supports regular files too) Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com