diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 16:36:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 16:36:41 -0400 |
commit | e2a0883e4071237d09b604a342c28b96b44a04b3 (patch) | |
tree | aa56f4d376b5eb1c32358c19c2669c2a94e0e1fd /drivers | |
parent | 3a990a52f9f25f45469e272017a31e7a3fda60ed (diff) | |
parent | 07c0c5d8b8c122b2f2df9ee574ac3083daefc981 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile 1 from Al Viro:
"This is _not_ all; in particular, Miklos' and Jan's stuff is not there
yet."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits)
ext4: initialization of ext4_li_mtx needs to be done earlier
debugfs-related mode_t whack-a-mole
hfsplus: add an ioctl to bless files
hfsplus: change finder_info to u32
hfsplus: initialise userflags
qnx4: new helper - try_extent()
qnx4: get rid of qnx4_bread/qnx4_getblk
take removal of PF_FORKNOEXEC to flush_old_exec()
trim includes in inode.c
um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it
um: embed ->stub_pages[] into mmu_context
gadgetfs: list_for_each_safe() misuse
ocfs2: fix leaks on failure exits in module_init
ecryptfs: make register_filesystem() the last potential failure exit
ntfs: forgets to unregister sysctls on register_filesystem() failure
logfs: missing cleanup on register_filesystem() failure
jfs: mising cleanup on register_filesystem() failure
make configfs_pin_fs() return root dentry on success
configfs: configfs_create_dir() has parent dentry in dentry->d_parent
configfs: sanitize configfs_create()
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/ibmasm/ibmasmfs.c | 16 | ||||
-rw-r--r-- | drivers/misc/ibmasm/module.c | 11 | ||||
-rw-r--r-- | drivers/mmc/card/block.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bnad_debugfs.c | 2 | ||||
-rw-r--r-- | drivers/oprofile/oprofilefs.c | 11 | ||||
-rw-r--r-- | drivers/usb/core/inode.c | 23 | ||||
-rw-r--r-- | drivers/usb/gadget/f_fs.c | 8 | ||||
-rw-r--r-- | drivers/usb/gadget/inode.c | 13 |
8 files changed, 25 insertions, 61 deletions
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index 35361753b487..1c034b80d408 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c | |||
@@ -87,7 +87,7 @@ | |||
87 | static LIST_HEAD(service_processors); | 87 | static LIST_HEAD(service_processors); |
88 | 88 | ||
89 | static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode); | 89 | static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode); |
90 | static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root); | 90 | static void ibmasmfs_create_files (struct super_block *sb); |
91 | static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent); | 91 | static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent); |
92 | 92 | ||
93 | 93 | ||
@@ -114,7 +114,6 @@ static struct file_system_type ibmasmfs_type = { | |||
114 | static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent) | 114 | static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent) |
115 | { | 115 | { |
116 | struct inode *root; | 116 | struct inode *root; |
117 | struct dentry *root_dentry; | ||
118 | 117 | ||
119 | sb->s_blocksize = PAGE_CACHE_SIZE; | 118 | sb->s_blocksize = PAGE_CACHE_SIZE; |
120 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 119 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; |
@@ -129,14 +128,11 @@ static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent) | |||
129 | root->i_op = &simple_dir_inode_operations; | 128 | root->i_op = &simple_dir_inode_operations; |
130 | root->i_fop = ibmasmfs_dir_ops; | 129 | root->i_fop = ibmasmfs_dir_ops; |
131 | 130 | ||
132 | root_dentry = d_alloc_root(root); | 131 | sb->s_root = d_make_root(root); |
133 | if (!root_dentry) { | 132 | if (!sb->s_root) |
134 | iput(root); | ||
135 | return -ENOMEM; | 133 | return -ENOMEM; |
136 | } | ||
137 | sb->s_root = root_dentry; | ||
138 | 134 | ||
139 | ibmasmfs_create_files(sb, root_dentry); | 135 | ibmasmfs_create_files(sb); |
140 | return 0; | 136 | return 0; |
141 | } | 137 | } |
142 | 138 | ||
@@ -612,7 +608,7 @@ static const struct file_operations remote_settings_fops = { | |||
612 | }; | 608 | }; |
613 | 609 | ||
614 | 610 | ||
615 | static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root) | 611 | static void ibmasmfs_create_files (struct super_block *sb) |
616 | { | 612 | { |
617 | struct list_head *entry; | 613 | struct list_head *entry; |
618 | struct service_processor *sp; | 614 | struct service_processor *sp; |
@@ -621,7 +617,7 @@ static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root) | |||
621 | struct dentry *dir; | 617 | struct dentry *dir; |
622 | struct dentry *remote_dir; | 618 | struct dentry *remote_dir; |
623 | sp = list_entry(entry, struct service_processor, node); | 619 | sp = list_entry(entry, struct service_processor, node); |
624 | dir = ibmasmfs_create_dir(sb, root, sp->dirname); | 620 | dir = ibmasmfs_create_dir(sb, sb->s_root, sp->dirname); |
625 | if (!dir) | 621 | if (!dir) |
626 | continue; | 622 | continue; |
627 | 623 | ||
diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c index 1ccedb71e728..168d8008f460 100644 --- a/drivers/misc/ibmasm/module.c +++ b/drivers/misc/ibmasm/module.c | |||
@@ -211,18 +211,17 @@ static void __exit ibmasm_exit (void) | |||
211 | 211 | ||
212 | static int __init ibmasm_init(void) | 212 | static int __init ibmasm_init(void) |
213 | { | 213 | { |
214 | int result; | 214 | int result = pci_register_driver(&ibmasm_driver); |
215 | if (result) | ||
216 | return result; | ||
215 | 217 | ||
216 | result = ibmasmfs_register(); | 218 | result = ibmasmfs_register(); |
217 | if (result) { | 219 | if (result) { |
220 | pci_unregister_driver(&ibmasm_driver); | ||
218 | err("Failed to register ibmasmfs file system"); | 221 | err("Failed to register ibmasmfs file system"); |
219 | return result; | 222 | return result; |
220 | } | 223 | } |
221 | result = pci_register_driver(&ibmasm_driver); | 224 | |
222 | if (result) { | ||
223 | ibmasmfs_unregister(); | ||
224 | return result; | ||
225 | } | ||
226 | ibmasm_register_panic_notifier(); | 225 | ibmasm_register_panic_notifier(); |
227 | info(DRIVER_DESC " version " DRIVER_VERSION " loaded"); | 226 | info(DRIVER_DESC " version " DRIVER_VERSION " loaded"); |
228 | return 0; | 227 | return 0; |
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index c6a383d0244d..e5a3c7b6dedb 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -1685,7 +1685,7 @@ static int mmc_add_disk(struct mmc_blk_data *md) | |||
1685 | 1685 | ||
1686 | if ((md->area_type & MMC_BLK_DATA_AREA_BOOT) && | 1686 | if ((md->area_type & MMC_BLK_DATA_AREA_BOOT) && |
1687 | card->ext_csd.boot_ro_lockable) { | 1687 | card->ext_csd.boot_ro_lockable) { |
1688 | mode_t mode; | 1688 | umode_t mode; |
1689 | 1689 | ||
1690 | if (card->ext_csd.boot_ro_lock & EXT_CSD_BOOT_WP_B_PWR_WP_DIS) | 1690 | if (card->ext_csd.boot_ro_lock & EXT_CSD_BOOT_WP_B_PWR_WP_DIS) |
1691 | mode = S_IRUGO; | 1691 | mode = S_IRUGO; |
diff --git a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c index c9fdceb135f3..6e8bc9d88c41 100644 --- a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c +++ b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c | |||
@@ -516,7 +516,7 @@ static const struct file_operations bnad_debugfs_op_drvinfo = { | |||
516 | 516 | ||
517 | struct bnad_debugfs_entry { | 517 | struct bnad_debugfs_entry { |
518 | const char *name; | 518 | const char *name; |
519 | mode_t mode; | 519 | umode_t mode; |
520 | const struct file_operations *fops; | 520 | const struct file_operations *fops; |
521 | }; | 521 | }; |
522 | 522 | ||
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index 2f0aa0f700e6..ee8fd037bb53 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c | |||
@@ -238,7 +238,6 @@ struct dentry *oprofilefs_mkdir(struct super_block *sb, | |||
238 | static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent) | 238 | static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent) |
239 | { | 239 | { |
240 | struct inode *root_inode; | 240 | struct inode *root_inode; |
241 | struct dentry *root_dentry; | ||
242 | 241 | ||
243 | sb->s_blocksize = PAGE_CACHE_SIZE; | 242 | sb->s_blocksize = PAGE_CACHE_SIZE; |
244 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 243 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; |
@@ -251,15 +250,11 @@ static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent) | |||
251 | return -ENOMEM; | 250 | return -ENOMEM; |
252 | root_inode->i_op = &simple_dir_inode_operations; | 251 | root_inode->i_op = &simple_dir_inode_operations; |
253 | root_inode->i_fop = &simple_dir_operations; | 252 | root_inode->i_fop = &simple_dir_operations; |
254 | root_dentry = d_alloc_root(root_inode); | 253 | sb->s_root = d_make_root(root_inode); |
255 | if (!root_dentry) { | 254 | if (!sb->s_root) |
256 | iput(root_inode); | ||
257 | return -ENOMEM; | 255 | return -ENOMEM; |
258 | } | ||
259 | |||
260 | sb->s_root = root_dentry; | ||
261 | 256 | ||
262 | oprofile_create_files(sb, root_dentry); | 257 | oprofile_create_files(sb, sb->s_root); |
263 | 258 | ||
264 | // FIXME: verify kill_litter_super removes our dentries | 259 | // FIXME: verify kill_litter_super removes our dentries |
265 | return 0; | 260 | return 0; |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 9e186f3da839..cefa0c8b5b6a 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -50,7 +50,6 @@ | |||
50 | static const struct file_operations default_file_operations; | 50 | static const struct file_operations default_file_operations; |
51 | static struct vfsmount *usbfs_mount; | 51 | static struct vfsmount *usbfs_mount; |
52 | static int usbfs_mount_count; /* = 0 */ | 52 | static int usbfs_mount_count; /* = 0 */ |
53 | static int ignore_mount = 0; | ||
54 | 53 | ||
55 | static struct dentry *devices_usbfs_dentry; | 54 | static struct dentry *devices_usbfs_dentry; |
56 | static int num_buses; /* = 0 */ | 55 | static int num_buses; /* = 0 */ |
@@ -256,7 +255,7 @@ static int remount(struct super_block *sb, int *flags, char *data) | |||
256 | * i.e. it's a simple_pin_fs from create_special_files, | 255 | * i.e. it's a simple_pin_fs from create_special_files, |
257 | * then ignore it. | 256 | * then ignore it. |
258 | */ | 257 | */ |
259 | if (ignore_mount) | 258 | if (*flags & MS_KERNMOUNT) |
260 | return 0; | 259 | return 0; |
261 | 260 | ||
262 | if (parse_options(sb, data)) { | 261 | if (parse_options(sb, data)) { |
@@ -454,7 +453,6 @@ static const struct super_operations usbfs_ops = { | |||
454 | static int usbfs_fill_super(struct super_block *sb, void *data, int silent) | 453 | static int usbfs_fill_super(struct super_block *sb, void *data, int silent) |
455 | { | 454 | { |
456 | struct inode *inode; | 455 | struct inode *inode; |
457 | struct dentry *root; | ||
458 | 456 | ||
459 | sb->s_blocksize = PAGE_CACHE_SIZE; | 457 | sb->s_blocksize = PAGE_CACHE_SIZE; |
460 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 458 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; |
@@ -462,19 +460,11 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent) | |||
462 | sb->s_op = &usbfs_ops; | 460 | sb->s_op = &usbfs_ops; |
463 | sb->s_time_gran = 1; | 461 | sb->s_time_gran = 1; |
464 | inode = usbfs_get_inode(sb, S_IFDIR | 0755, 0); | 462 | inode = usbfs_get_inode(sb, S_IFDIR | 0755, 0); |
465 | 463 | sb->s_root = d_make_root(inode); | |
466 | if (!inode) { | 464 | if (!sb->s_root) { |
467 | dbg("%s: could not get inode!",__func__); | ||
468 | return -ENOMEM; | ||
469 | } | ||
470 | |||
471 | root = d_alloc_root(inode); | ||
472 | if (!root) { | ||
473 | dbg("%s: could not get root dentry!",__func__); | 465 | dbg("%s: could not get root dentry!",__func__); |
474 | iput(inode); | ||
475 | return -ENOMEM; | 466 | return -ENOMEM; |
476 | } | 467 | } |
477 | sb->s_root = root; | ||
478 | return 0; | 468 | return 0; |
479 | } | 469 | } |
480 | 470 | ||
@@ -591,11 +581,6 @@ static int create_special_files (void) | |||
591 | struct dentry *parent; | 581 | struct dentry *parent; |
592 | int retval; | 582 | int retval; |
593 | 583 | ||
594 | /* the simple_pin_fs calls will call remount with no options | ||
595 | * without this flag that would overwrite the real mount options (if any) | ||
596 | */ | ||
597 | ignore_mount = 1; | ||
598 | |||
599 | /* create the devices special file */ | 584 | /* create the devices special file */ |
600 | retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count); | 585 | retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count); |
601 | if (retval) { | 586 | if (retval) { |
@@ -603,8 +588,6 @@ static int create_special_files (void) | |||
603 | goto exit; | 588 | goto exit; |
604 | } | 589 | } |
605 | 590 | ||
606 | ignore_mount = 0; | ||
607 | |||
608 | parent = usbfs_mount->mnt_root; | 591 | parent = usbfs_mount->mnt_root; |
609 | devices_usbfs_dentry = fs_create_file ("devices", | 592 | devices_usbfs_dentry = fs_create_file ("devices", |
610 | listmode | S_IFREG, parent, | 593 | listmode | S_IFREG, parent, |
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 7f445ec723bc..1cbba70836bc 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
@@ -1063,13 +1063,9 @@ static int ffs_sb_fill(struct super_block *sb, void *_data, int silent) | |||
1063 | &simple_dir_operations, | 1063 | &simple_dir_operations, |
1064 | &simple_dir_inode_operations, | 1064 | &simple_dir_inode_operations, |
1065 | &data->perms); | 1065 | &data->perms); |
1066 | if (unlikely(!inode)) | 1066 | sb->s_root = d_make_root(inode); |
1067 | if (unlikely(!sb->s_root)) | ||
1067 | goto Enomem; | 1068 | goto Enomem; |
1068 | sb->s_root = d_alloc_root(inode); | ||
1069 | if (unlikely(!sb->s_root)) { | ||
1070 | iput(inode); | ||
1071 | goto Enomem; | ||
1072 | } | ||
1073 | 1069 | ||
1074 | /* EP0 file */ | 1070 | /* EP0 file */ |
1075 | if (unlikely(!ffs_sb_create_file(sb, "ep0", ffs, | 1071 | if (unlikely(!ffs_sb_create_file(sb, "ep0", ffs, |
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index 4f18a0e46070..8793f32bab11 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
@@ -1571,20 +1571,18 @@ delegate: | |||
1571 | 1571 | ||
1572 | static void destroy_ep_files (struct dev_data *dev) | 1572 | static void destroy_ep_files (struct dev_data *dev) |
1573 | { | 1573 | { |
1574 | struct list_head *entry, *tmp; | ||
1575 | |||
1576 | DBG (dev, "%s %d\n", __func__, dev->state); | 1574 | DBG (dev, "%s %d\n", __func__, dev->state); |
1577 | 1575 | ||
1578 | /* dev->state must prevent interference */ | 1576 | /* dev->state must prevent interference */ |
1579 | restart: | 1577 | restart: |
1580 | spin_lock_irq (&dev->lock); | 1578 | spin_lock_irq (&dev->lock); |
1581 | list_for_each_safe (entry, tmp, &dev->epfiles) { | 1579 | while (!list_empty(&dev->epfiles)) { |
1582 | struct ep_data *ep; | 1580 | struct ep_data *ep; |
1583 | struct inode *parent; | 1581 | struct inode *parent; |
1584 | struct dentry *dentry; | 1582 | struct dentry *dentry; |
1585 | 1583 | ||
1586 | /* break link to FS */ | 1584 | /* break link to FS */ |
1587 | ep = list_entry (entry, struct ep_data, epfiles); | 1585 | ep = list_first_entry (&dev->epfiles, struct ep_data, epfiles); |
1588 | list_del_init (&ep->epfiles); | 1586 | list_del_init (&ep->epfiles); |
1589 | dentry = ep->dentry; | 1587 | dentry = ep->dentry; |
1590 | ep->dentry = NULL; | 1588 | ep->dentry = NULL; |
@@ -1607,8 +1605,7 @@ restart: | |||
1607 | dput (dentry); | 1605 | dput (dentry); |
1608 | mutex_unlock (&parent->i_mutex); | 1606 | mutex_unlock (&parent->i_mutex); |
1609 | 1607 | ||
1610 | /* fds may still be open */ | 1608 | spin_lock_irq (&dev->lock); |
1611 | goto restart; | ||
1612 | } | 1609 | } |
1613 | spin_unlock_irq (&dev->lock); | 1610 | spin_unlock_irq (&dev->lock); |
1614 | } | 1611 | } |
@@ -2061,10 +2058,8 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent) | |||
2061 | if (!inode) | 2058 | if (!inode) |
2062 | goto Enomem; | 2059 | goto Enomem; |
2063 | inode->i_op = &simple_dir_inode_operations; | 2060 | inode->i_op = &simple_dir_inode_operations; |
2064 | if (!(sb->s_root = d_alloc_root (inode))) { | 2061 | if (!(sb->s_root = d_make_root (inode))) |
2065 | iput(inode); | ||
2066 | goto Enomem; | 2062 | goto Enomem; |
2067 | } | ||
2068 | 2063 | ||
2069 | /* the ep0 file is named after the controller we expect; | 2064 | /* the ep0 file is named after the controller we expect; |
2070 | * user mode code can use it for sanity checks, like we do. | 2065 | * user mode code can use it for sanity checks, like we do. |