summaryrefslogtreecommitdiffstats
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-02-27 17:07:12 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2021-02-27 17:07:12 +0100
commit5ceabb6078b80a8544ba86d6ee523ad755ae6d5e (patch)
tree69ebf199a0fb3caece18596ad11f75354a96b654 /drivers/block/loop.c
parentMerge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff)
parentwhack-a-mole: don't open-code iminor/imajor (diff)
downloadlinux-5ceabb6078b80a8544ba86d6ee523ad755ae6d5e.tar.xz
linux-5ceabb6078b80a8544ba86d6ee523ad755ae6d5e.zip
Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc vfs updates from Al Viro: "Assorted stuff pile - no common topic here" * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: whack-a-mole: don't open-code iminor/imajor 9p: fix misuse of sscanf() in v9fs_stat2inode() audit_alloc_mark(): don't open-code ERR_CAST() fs/inode.c: make inode_init_always() initialize i_ino to 0 vfs: don't unnecessarily clone write access for writable fds
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 578fc034db3f..a06b99473ca0 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -663,7 +663,7 @@ static inline int is_loop_device(struct file *file)
{
struct inode *i = file->f_mapping->host;
- return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR;
+ return i && S_ISBLK(i->i_mode) && imajor(i) == LOOP_MAJOR;
}
static int loop_validate_file(struct file *file, struct block_device *bdev)