Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107512
b: refs/heads/master
c: f1136d0
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 2, 2008
1 parent 840cffc commit 8245365
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 759da9267177e5005c8f21e11d29d26f4f459744
refs/heads/master: f1136d022af8f07a97f59c6d07483bdb82ffbd8e
17 changes: 12 additions & 5 deletions trunk/drivers/mtd/mtdsuper.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
int (*fill_super)(struct super_block *, void *, int),
struct vfsmount *mnt)
{
#ifdef CONFIG_BLOCK
struct block_device *bdev;
int mtdnr, ret;
int ret, major;
#endif
int mtdnr;

if (!dev_name)
return -EINVAL;
Expand Down Expand Up @@ -178,6 +181,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
}
}

#ifdef CONFIG_BLOCK
/* try the old way - the hack where we allowed users to mount
* /dev/mtdblock$(n) but didn't actually _use_ the blockdev
*/
Expand All @@ -190,22 +194,25 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
DEBUG(1, "MTDSB: lookup_bdev() returned 0\n");

ret = -EINVAL;
if (MAJOR(bdev->bd_dev) != MTD_BLOCK_MAJOR)
goto not_an_MTD_device;

major = MAJOR(bdev->bd_dev);
mtdnr = MINOR(bdev->bd_dev);
bdput(bdev);

if (major != MTD_BLOCK_MAJOR)
goto not_an_MTD_device;

return get_sb_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super,
mnt);

not_an_MTD_device:
#endif /* CONFIG_BLOCK */

if (!(flags & MS_SILENT))
printk(KERN_NOTICE
"MTD: Attempt to mount non-MTD device \"%s\"\n",
dev_name);
bdput(bdev);
return ret;
return -EINVAL;
}

EXPORT_SYMBOL_GPL(get_sb_mtd);
Expand Down

0 comments on commit 8245365

Please sign in to comment.