diff options
| author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-02-25 22:41:00 -0500 |
|---|---|---|
| committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-02-25 22:41:00 -0500 |
| commit | 874f2f997dbe041a6c6e509dae8656ed9022d65d (patch) | |
| tree | 61898165882041ef7f9beaf2ef6663a1a4d3c29a /fs | |
| parent | 071c06cb570d38efe23a124e885f2f3e643a9206 (diff) | |
| parent | 6ebdc661b608671e9ca572af8bb42d58108cc008 (diff) | |
Merge commit 'origin/master' into next
Manual merge of:
drivers/char/hvc_console.c
drivers/char/hvc_console.h
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/cachefiles/namei.c | 12 | ||||
| -rw-r--r-- | fs/exec.c | 1 | ||||
| -rw-r--r-- | fs/namei.c | 14 | ||||
| -rw-r--r-- | fs/nfsd/vfs.c | 3 | ||||
| -rw-r--r-- | fs/proc/base.c | 24 | ||||
| -rw-r--r-- | fs/proc/proc_devtree.c | 7 | ||||
| -rw-r--r-- | fs/sysfs/inode.c | 35 |
7 files changed, 66 insertions, 30 deletions
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index 14ac4806e291..eeb4986ea7db 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c | |||
| @@ -348,7 +348,17 @@ int cachefiles_delete_object(struct cachefiles_cache *cache, | |||
| 348 | dir = dget_parent(object->dentry); | 348 | dir = dget_parent(object->dentry); |
| 349 | 349 | ||
| 350 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); | 350 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); |
| 351 | ret = cachefiles_bury_object(cache, dir, object->dentry); | 351 | |
| 352 | /* we need to check that our parent is _still_ our parent - it may have | ||
| 353 | * been renamed */ | ||
| 354 | if (dir == object->dentry->d_parent) { | ||
| 355 | ret = cachefiles_bury_object(cache, dir, object->dentry); | ||
| 356 | } else { | ||
| 357 | /* it got moved, presumably by cachefilesd culling it, so it's | ||
| 358 | * no longer in the key path and we can ignore it */ | ||
| 359 | mutex_unlock(&dir->d_inode->i_mutex); | ||
| 360 | ret = 0; | ||
| 361 | } | ||
| 352 | 362 | ||
| 353 | dput(dir); | 363 | dput(dir); |
| 354 | _leave(" = %d", ret); | 364 | _leave(" = %d", ret); |
| @@ -637,7 +637,6 @@ int setup_arg_pages(struct linux_binprm *bprm, | |||
| 637 | * will align it up. | 637 | * will align it up. |
| 638 | */ | 638 | */ |
| 639 | rlim_stack = rlimit(RLIMIT_STACK) & PAGE_MASK; | 639 | rlim_stack = rlimit(RLIMIT_STACK) & PAGE_MASK; |
| 640 | rlim_stack = min(rlim_stack, stack_size); | ||
| 641 | #ifdef CONFIG_STACK_GROWSUP | 640 | #ifdef CONFIG_STACK_GROWSUP |
| 642 | if (stack_size + stack_expand > rlim_stack) | 641 | if (stack_size + stack_expand > rlim_stack) |
| 643 | stack_base = vma->vm_start + rlim_stack; | 642 | stack_base = vma->vm_start + rlim_stack; |
diff --git a/fs/namei.c b/fs/namei.c index d62fdc875f22..a4855af776a8 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
| @@ -823,6 +823,17 @@ fail: | |||
| 823 | } | 823 | } |
| 824 | 824 | ||
| 825 | /* | 825 | /* |
| 826 | * This is a temporary kludge to deal with "automount" symlinks; proper | ||
| 827 | * solution is to trigger them on follow_mount(), so that do_lookup() | ||
| 828 | * would DTRT. To be killed before 2.6.34-final. | ||
| 829 | */ | ||
| 830 | static inline int follow_on_final(struct inode *inode, unsigned lookup_flags) | ||
| 831 | { | ||
| 832 | return inode && unlikely(inode->i_op->follow_link) && | ||
| 833 | ((lookup_flags & LOOKUP_FOLLOW) || S_ISDIR(inode->i_mode)); | ||
| 834 | } | ||
| 835 | |||
| 836 | /* | ||
| 826 | * Name resolution. | 837 | * Name resolution. |
| 827 | * This is the basic name resolution function, turning a pathname into | 838 | * This is the basic name resolution function, turning a pathname into |
| 828 | * the final dentry. We expect 'base' to be positive and a directory. | 839 | * the final dentry. We expect 'base' to be positive and a directory. |
| @@ -942,8 +953,7 @@ last_component: | |||
| 942 | if (err) | 953 | if (err) |
| 943 | break; | 954 | break; |
| 944 | inode = next.dentry->d_inode; | 955 | inode = next.dentry->d_inode; |
| 945 | if ((lookup_flags & LOOKUP_FOLLOW) | 956 | if (follow_on_final(inode, lookup_flags)) { |
| 946 | && inode && inode->i_op->follow_link) { | ||
| 947 | err = do_follow_link(&next, nd); | 957 | err = do_follow_link(&next, nd); |
| 948 | if (err) | 958 | if (err) |
| 949 | goto return_err; | 959 | goto return_err; |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 97d79eff6b7f..8715d194561a 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
| @@ -752,7 +752,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
| 752 | flags, current_cred()); | 752 | flags, current_cred()); |
| 753 | if (IS_ERR(*filp)) | 753 | if (IS_ERR(*filp)) |
| 754 | host_err = PTR_ERR(*filp); | 754 | host_err = PTR_ERR(*filp); |
| 755 | host_err = ima_file_check(*filp, access); | 755 | else |
| 756 | host_err = ima_file_check(*filp, access); | ||
| 756 | out_nfserr: | 757 | out_nfserr: |
| 757 | err = nfserrno(host_err); | 758 | err = nfserrno(host_err); |
| 758 | out: | 759 | out: |
diff --git a/fs/proc/base.c b/fs/proc/base.c index e42bbd843ed1..58324c299165 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -2369,16 +2369,30 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
| 2369 | { | 2369 | { |
| 2370 | struct pid_namespace *ns = dentry->d_sb->s_fs_info; | 2370 | struct pid_namespace *ns = dentry->d_sb->s_fs_info; |
| 2371 | pid_t tgid = task_tgid_nr_ns(current, ns); | 2371 | pid_t tgid = task_tgid_nr_ns(current, ns); |
| 2372 | char tmp[PROC_NUMBUF]; | 2372 | char *name = ERR_PTR(-ENOENT); |
| 2373 | if (!tgid) | 2373 | if (tgid) { |
| 2374 | return ERR_PTR(-ENOENT); | 2374 | name = __getname(); |
| 2375 | sprintf(tmp, "%d", task_tgid_nr_ns(current, ns)); | 2375 | if (!name) |
| 2376 | return ERR_PTR(vfs_follow_link(nd,tmp)); | 2376 | name = ERR_PTR(-ENOMEM); |
| 2377 | else | ||
| 2378 | sprintf(name, "%d", tgid); | ||
| 2379 | } | ||
| 2380 | nd_set_link(nd, name); | ||
| 2381 | return NULL; | ||
| 2382 | } | ||
| 2383 | |||
| 2384 | static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd, | ||
| 2385 | void *cookie) | ||
| 2386 | { | ||
| 2387 | char *s = nd_get_link(nd); | ||
| 2388 | if (!IS_ERR(s)) | ||
| 2389 | __putname(s); | ||
| 2377 | } | 2390 | } |
| 2378 | 2391 | ||
| 2379 | static const struct inode_operations proc_self_inode_operations = { | 2392 | static const struct inode_operations proc_self_inode_operations = { |
| 2380 | .readlink = proc_self_readlink, | 2393 | .readlink = proc_self_readlink, |
| 2381 | .follow_link = proc_self_follow_link, | 2394 | .follow_link = proc_self_follow_link, |
| 2395 | .put_link = proc_self_put_link, | ||
| 2382 | }; | 2396 | }; |
| 2383 | 2397 | ||
| 2384 | /* | 2398 | /* |
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c index 123257bb356b..f8650dce74fb 100644 --- a/fs/proc/proc_devtree.c +++ b/fs/proc/proc_devtree.c | |||
| @@ -10,16 +10,19 @@ | |||
| 10 | #include <linux/seq_file.h> | 10 | #include <linux/seq_file.h> |
| 11 | #include <linux/stat.h> | 11 | #include <linux/stat.h> |
| 12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
| 13 | #include <linux/of.h> | ||
| 14 | #include <linux/module.h> | ||
| 13 | #include <asm/prom.h> | 15 | #include <asm/prom.h> |
| 14 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
| 15 | #include "internal.h" | 17 | #include "internal.h" |
| 16 | 18 | ||
| 17 | #ifndef HAVE_ARCH_DEVTREE_FIXUPS | ||
| 18 | static inline void set_node_proc_entry(struct device_node *np, | 19 | static inline void set_node_proc_entry(struct device_node *np, |
| 19 | struct proc_dir_entry *de) | 20 | struct proc_dir_entry *de) |
| 20 | { | 21 | { |
| 21 | } | 22 | #ifdef HAVE_ARCH_DEVTREE_FIXUPS |
| 23 | np->pde = de; | ||
| 22 | #endif | 24 | #endif |
| 25 | } | ||
| 23 | 26 | ||
| 24 | static struct proc_dir_entry *proc_device_tree; | 27 | static struct proc_dir_entry *proc_device_tree; |
| 25 | 28 | ||
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 220b758523ae..6a06a1d1ea7b 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
| @@ -81,24 +81,23 @@ int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr * iattr) | |||
| 81 | if (!sd_attrs) | 81 | if (!sd_attrs) |
| 82 | return -ENOMEM; | 82 | return -ENOMEM; |
| 83 | sd->s_iattr = sd_attrs; | 83 | sd->s_iattr = sd_attrs; |
| 84 | } else { | 84 | } |
| 85 | /* attributes were changed at least once in past */ | 85 | /* attributes were changed at least once in past */ |
| 86 | iattrs = &sd_attrs->ia_iattr; | 86 | iattrs = &sd_attrs->ia_iattr; |
| 87 | 87 | ||
| 88 | if (ia_valid & ATTR_UID) | 88 | if (ia_valid & ATTR_UID) |
| 89 | iattrs->ia_uid = iattr->ia_uid; | 89 | iattrs->ia_uid = iattr->ia_uid; |
| 90 | if (ia_valid & ATTR_GID) | 90 | if (ia_valid & ATTR_GID) |
| 91 | iattrs->ia_gid = iattr->ia_gid; | 91 | iattrs->ia_gid = iattr->ia_gid; |
| 92 | if (ia_valid & ATTR_ATIME) | 92 | if (ia_valid & ATTR_ATIME) |
| 93 | iattrs->ia_atime = iattr->ia_atime; | 93 | iattrs->ia_atime = iattr->ia_atime; |
| 94 | if (ia_valid & ATTR_MTIME) | 94 | if (ia_valid & ATTR_MTIME) |
| 95 | iattrs->ia_mtime = iattr->ia_mtime; | 95 | iattrs->ia_mtime = iattr->ia_mtime; |
| 96 | if (ia_valid & ATTR_CTIME) | 96 | if (ia_valid & ATTR_CTIME) |
| 97 | iattrs->ia_ctime = iattr->ia_ctime; | 97 | iattrs->ia_ctime = iattr->ia_ctime; |
| 98 | if (ia_valid & ATTR_MODE) { | 98 | if (ia_valid & ATTR_MODE) { |
| 99 | umode_t mode = iattr->ia_mode; | 99 | umode_t mode = iattr->ia_mode; |
| 100 | iattrs->ia_mode = sd->s_mode = mode; | 100 | iattrs->ia_mode = sd->s_mode = mode; |
| 101 | } | ||
| 102 | } | 101 | } |
| 103 | return 0; | 102 | return 0; |
| 104 | } | 103 | } |
