]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - block/compat_ioctl.c
[PATCH 1/2] kill FMODE_NDELAY_NOW
[linux-2.6-omap-h63xx.git] / block / compat_ioctl.c
index d43e6087badc4bf728a77ff90a5901edd91224b3..67eb93cff699ba2a4dc9231f73c0d4d46d9fc443 100644 (file)
@@ -722,8 +722,14 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
        struct backing_dev_info *bdi;
        loff_t size;
 
+       /*
+        * O_NDELAY can be altered using fcntl(.., F_SETFL, ..), so we have
+        * to updated it before every ioctl.
+        */
        if (file->f_flags & O_NDELAY)
-               mode |= FMODE_NDELAY_NOW;
+               mode |= FMODE_NDELAY;
+       else
+               mode &= ~FMODE_NDELAY;
 
        switch (cmd) {
        case HDIO_GETGEO: