diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-10 13:49:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-10 13:49:08 -0400 |
commit | 93b49d45eb97574057ee03dfdd590c209f5132f8 (patch) | |
tree | d01e5af58331ab6a8c758e445aeb943cf803dfa9 /drivers | |
parent | f9f51cc0ce544224a8332a4c1733624fcbc70a32 (diff) | |
parent | b0c4f3222c7406f0aee9d52b7d604a1d36108463 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (22 commits)
Fix the race between capifs remount and node creation
Fix races around the access to ->s_options
switch ufs directories to ufs_sync_file()
Switch open_exec() and sys_uselib() to do_open_filp()
Make open_exec() and sys_uselib() use may_open(), instead of duplicating its parts
Reduce path_lookup() abuses
Make checkpatch.pl shut up on fs/inode.c
NULL noise in fs/super.c:kill_bdev_super()
romfs: cleanup romfs_fs.h
ROMFS: romfs_dev_read() error ignored
fs: dcache fix LRU ordering
ocfs2: Use nd_set_link().
Fix deadlock in ipathfs ->get_sb()
Fix a leak in failure exit in 9p ->get_sb()
Convert obvious places to deactivate_locked_super()
New helper: deactivate_locked_super()
reiserfs: remove privroot hiding in lookup
reiserfs: dont associate security.* with xattr files
reiserfs: fixup xattr_root caching
Always lookup priv_root on reiserfs mount and keep it
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_fs.c | 2 | ||||
-rw-r--r-- | drivers/isdn/capi/capifs.c | 11 | ||||
-rw-r--r-- | drivers/mtd/mtdsuper.c | 3 | ||||
-rw-r--r-- | drivers/scsi/osd/osd_uld.c | 20 |
4 files changed, 20 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c index 8dc2bb781605..b3684060465e 100644 --- a/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/drivers/infiniband/hw/ipath/ipath_fs.c | |||
@@ -347,7 +347,7 @@ static int ipathfs_fill_super(struct super_block *sb, void *data, | |||
347 | spin_unlock_irqrestore(&ipath_devs_lock, flags); | 347 | spin_unlock_irqrestore(&ipath_devs_lock, flags); |
348 | ret = create_device_files(sb, dd); | 348 | ret = create_device_files(sb, dd); |
349 | if (ret) { | 349 | if (ret) { |
350 | deactivate_super(sb); | 350 | deactivate_locked_super(sb); |
351 | goto bail; | 351 | goto bail; |
352 | } | 352 | } |
353 | spin_lock_irqsave(&ipath_devs_lock, flags); | 353 | spin_lock_irqsave(&ipath_devs_lock, flags); |
diff --git a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c index b129409925af..bff72d81f263 100644 --- a/drivers/isdn/capi/capifs.c +++ b/drivers/isdn/capi/capifs.c | |||
@@ -75,15 +75,17 @@ static int capifs_remount(struct super_block *s, int *flags, char *data) | |||
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | kfree(s->s_options); | 78 | mutex_lock(&s->s_root->d_inode->i_mutex); |
79 | s->s_options = new_opt; | ||
80 | 79 | ||
80 | replace_mount_options(s, new_opt); | ||
81 | config.setuid = setuid; | 81 | config.setuid = setuid; |
82 | config.setgid = setgid; | 82 | config.setgid = setgid; |
83 | config.uid = uid; | 83 | config.uid = uid; |
84 | config.gid = gid; | 84 | config.gid = gid; |
85 | config.mode = mode; | 85 | config.mode = mode; |
86 | 86 | ||
87 | mutex_unlock(&s->s_root->d_inode->i_mutex); | ||
88 | |||
87 | return 0; | 89 | return 0; |
88 | } | 90 | } |
89 | 91 | ||
@@ -154,13 +156,16 @@ void capifs_new_ncci(unsigned int number, dev_t device) | |||
154 | if (!inode) | 156 | if (!inode) |
155 | return; | 157 | return; |
156 | inode->i_ino = number+2; | 158 | inode->i_ino = number+2; |
159 | |||
160 | dentry = get_node(number); | ||
161 | |||
162 | /* config contents is protected by root's i_mutex */ | ||
157 | inode->i_uid = config.setuid ? config.uid : current_fsuid(); | 163 | inode->i_uid = config.setuid ? config.uid : current_fsuid(); |
158 | inode->i_gid = config.setgid ? config.gid : current_fsgid(); | 164 | inode->i_gid = config.setgid ? config.gid : current_fsgid(); |
159 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 165 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
160 | init_special_inode(inode, S_IFCHR|config.mode, device); | 166 | init_special_inode(inode, S_IFCHR|config.mode, device); |
161 | //inode->i_op = &capifs_file_inode_operations; | 167 | //inode->i_op = &capifs_file_inode_operations; |
162 | 168 | ||
163 | dentry = get_node(number); | ||
164 | if (!IS_ERR(dentry) && !dentry->d_inode) | 169 | if (!IS_ERR(dentry) && !dentry->d_inode) |
165 | d_instantiate(dentry, inode); | 170 | d_instantiate(dentry, inode); |
166 | mutex_unlock(&capifs_root->d_inode->i_mutex); | 171 | mutex_unlock(&capifs_root->d_inode->i_mutex); |
diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c index 92285d0089c2..af8b42e0a55b 100644 --- a/drivers/mtd/mtdsuper.c +++ b/drivers/mtd/mtdsuper.c | |||
@@ -74,8 +74,7 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags, | |||
74 | 74 | ||
75 | ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0); | 75 | ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0); |
76 | if (ret < 0) { | 76 | if (ret < 0) { |
77 | up_write(&sb->s_umount); | 77 | deactivate_locked_super(sb); |
78 | deactivate_super(sb); | ||
79 | return ret; | 78 | return ret; |
80 | } | 79 | } |
81 | 80 | ||
diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c index f644c9571eab..22b59e13ba83 100644 --- a/drivers/scsi/osd/osd_uld.c +++ b/drivers/scsi/osd/osd_uld.c | |||
@@ -173,26 +173,26 @@ static const struct file_operations osd_fops = { | |||
173 | .unlocked_ioctl = osd_uld_ioctl, | 173 | .unlocked_ioctl = osd_uld_ioctl, |
174 | }; | 174 | }; |
175 | 175 | ||
176 | struct osd_dev *osduld_path_lookup(const char *path) | 176 | struct osd_dev *osduld_path_lookup(const char *name) |
177 | { | 177 | { |
178 | struct nameidata nd; | 178 | struct path path; |
179 | struct inode *inode; | 179 | struct inode *inode; |
180 | struct cdev *cdev; | 180 | struct cdev *cdev; |
181 | struct osd_uld_device *uninitialized_var(oud); | 181 | struct osd_uld_device *uninitialized_var(oud); |
182 | int error; | 182 | int error; |
183 | 183 | ||
184 | if (!path || !*path) { | 184 | if (!name || !*name) { |
185 | OSD_ERR("Mount with !path || !*path\n"); | 185 | OSD_ERR("Mount with !path || !*path\n"); |
186 | return ERR_PTR(-EINVAL); | 186 | return ERR_PTR(-EINVAL); |
187 | } | 187 | } |
188 | 188 | ||
189 | error = path_lookup(path, LOOKUP_FOLLOW, &nd); | 189 | error = kern_path(name, LOOKUP_FOLLOW, &path); |
190 | if (error) { | 190 | if (error) { |
191 | OSD_ERR("path_lookup of %s faild=>%d\n", path, error); | 191 | OSD_ERR("path_lookup of %s failed=>%d\n", name, error); |
192 | return ERR_PTR(error); | 192 | return ERR_PTR(error); |
193 | } | 193 | } |
194 | 194 | ||
195 | inode = nd.path.dentry->d_inode; | 195 | inode = path.dentry->d_inode; |
196 | error = -EINVAL; /* Not the right device e.g osd_uld_device */ | 196 | error = -EINVAL; /* Not the right device e.g osd_uld_device */ |
197 | if (!S_ISCHR(inode->i_mode)) { | 197 | if (!S_ISCHR(inode->i_mode)) { |
198 | OSD_DEBUG("!S_ISCHR()\n"); | 198 | OSD_DEBUG("!S_ISCHR()\n"); |
@@ -202,15 +202,15 @@ struct osd_dev *osduld_path_lookup(const char *path) | |||
202 | cdev = inode->i_cdev; | 202 | cdev = inode->i_cdev; |
203 | if (!cdev) { | 203 | if (!cdev) { |
204 | OSD_ERR("Before mounting an OSD Based filesystem\n"); | 204 | OSD_ERR("Before mounting an OSD Based filesystem\n"); |
205 | OSD_ERR(" user-mode must open+close the %s device\n", path); | 205 | OSD_ERR(" user-mode must open+close the %s device\n", name); |
206 | OSD_ERR(" Example: bash: echo < %s\n", path); | 206 | OSD_ERR(" Example: bash: echo < %s\n", name); |
207 | goto out; | 207 | goto out; |
208 | } | 208 | } |
209 | 209 | ||
210 | /* The Magic wand. Is it our char-dev */ | 210 | /* The Magic wand. Is it our char-dev */ |
211 | /* TODO: Support sg devices */ | 211 | /* TODO: Support sg devices */ |
212 | if (cdev->owner != THIS_MODULE) { | 212 | if (cdev->owner != THIS_MODULE) { |
213 | OSD_ERR("Error mounting %s - is not an OSD device\n", path); | 213 | OSD_ERR("Error mounting %s - is not an OSD device\n", name); |
214 | goto out; | 214 | goto out; |
215 | } | 215 | } |
216 | 216 | ||
@@ -220,7 +220,7 @@ struct osd_dev *osduld_path_lookup(const char *path) | |||
220 | error = 0; | 220 | error = 0; |
221 | 221 | ||
222 | out: | 222 | out: |
223 | path_put(&nd.path); | 223 | path_put(&path); |
224 | return error ? ERR_PTR(error) : &oud->od; | 224 | return error ? ERR_PTR(error) : &oud->od; |
225 | } | 225 | } |
226 | EXPORT_SYMBOL(osduld_path_lookup); | 226 | EXPORT_SYMBOL(osduld_path_lookup); |