You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/bdev
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/bdev: [PATCH] fix bogus argument of blkdev_put() in pktcdvd [PATCH 2/2] documnt FMODE_ constants [PATCH 1/2] kill FMODE_NDELAY_NOW [PATCH] clean up blkdev_get a little bit [PATCH] Fix block dev compat ioctl handling [PATCH] kill obsolete temporary comment in swsusp_close()
This commit is contained in:
+16
-5
@@ -1135,12 +1135,15 @@ static int blkdev_open(struct inode * inode, struct file * filp)
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
if (!(filp->f_mode & FMODE_EXCL))
|
||||
return 0;
|
||||
if (filp->f_mode & FMODE_EXCL) {
|
||||
res = bd_claim(bdev, filp);
|
||||
if (res)
|
||||
goto out_blkdev_put;
|
||||
}
|
||||
|
||||
if (!(res = bd_claim(bdev, filp)))
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
out_blkdev_put:
|
||||
blkdev_put(bdev, filp->f_mode);
|
||||
return res;
|
||||
}
|
||||
@@ -1203,8 +1206,16 @@ static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
|
||||
{
|
||||
struct block_device *bdev = I_BDEV(file->f_mapping->host);
|
||||
fmode_t mode = file->f_mode;
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
return blkdev_ioctl(bdev, mode, cmd, arg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user