aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ecryptfs/inode.c4
-rw-r--r--fs/namei.c4
-rw-r--r--fs/nfsd/vfs.c10
-rw-r--r--include/linux/fs.h2
4 files changed, 6 insertions, 14 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 32f4228efcd5..f25caf2b0887 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -465,7 +465,6 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry,
465 int rc; 465 int rc;
466 struct dentry *lower_dentry; 466 struct dentry *lower_dentry;
467 struct dentry *lower_dir_dentry; 467 struct dentry *lower_dir_dentry;
468 umode_t mode;
469 char *encoded_symname; 468 char *encoded_symname;
470 int encoded_symlen; 469 int encoded_symlen;
471 struct ecryptfs_crypt_stat *crypt_stat = NULL; 470 struct ecryptfs_crypt_stat *crypt_stat = NULL;
@@ -473,7 +472,6 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry,
473 lower_dentry = ecryptfs_dentry_to_lower(dentry); 472 lower_dentry = ecryptfs_dentry_to_lower(dentry);
474 dget(lower_dentry); 473 dget(lower_dentry);
475 lower_dir_dentry = lock_parent(lower_dentry); 474 lower_dir_dentry = lock_parent(lower_dentry);
476 mode = S_IALLUGO;
477 encoded_symlen = ecryptfs_encode_filename(crypt_stat, symname, 475 encoded_symlen = ecryptfs_encode_filename(crypt_stat, symname,
478 strlen(symname), 476 strlen(symname),
479 &encoded_symname); 477 &encoded_symname);
@@ -482,7 +480,7 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry,
482 goto out_lock; 480 goto out_lock;
483 } 481 }
484 rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry, 482 rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry,
485 encoded_symname, mode); 483 encoded_symname);
486 kfree(encoded_symname); 484 kfree(encoded_symname);
487 if (rc || !lower_dentry->d_inode) 485 if (rc || !lower_dentry->d_inode)
488 goto out_lock; 486 goto out_lock;
diff --git a/fs/namei.c b/fs/namei.c
index 3b67be7631dc..ae0e56fdb742 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2434,7 +2434,7 @@ asmlinkage long sys_unlink(const char __user *pathname)
2434 return do_unlinkat(AT_FDCWD, pathname); 2434 return do_unlinkat(AT_FDCWD, pathname);
2435} 2435}
2436 2436
2437int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname, int mode) 2437int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
2438{ 2438{
2439 int error = may_create(dir, dentry, NULL); 2439 int error = may_create(dir, dentry, NULL);
2440 2440
@@ -2483,7 +2483,7 @@ asmlinkage long sys_symlinkat(const char __user *oldname,
2483 error = mnt_want_write(nd.path.mnt); 2483 error = mnt_want_write(nd.path.mnt);
2484 if (error) 2484 if (error)
2485 goto out_dput; 2485 goto out_dput;
2486 error = vfs_symlink(nd.path.dentry->d_inode, dentry, from, S_IALLUGO); 2486 error = vfs_symlink(nd.path.dentry->d_inode, dentry, from);
2487 mnt_drop_write(nd.path.mnt); 2487 mnt_drop_write(nd.path.mnt);
2488out_dput: 2488out_dput:
2489 dput(dentry); 2489 dput(dentry);
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 0f4481e0502d..ad1ad59e3742 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1516,7 +1516,6 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
1516 struct dentry *dentry, *dnew; 1516 struct dentry *dentry, *dnew;
1517 __be32 err, cerr; 1517 __be32 err, cerr;
1518 int host_err; 1518 int host_err;
1519 umode_t mode;
1520 1519
1521 err = nfserr_noent; 1520 err = nfserr_noent;
1522 if (!flen || !plen) 1521 if (!flen || !plen)
@@ -1535,11 +1534,6 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
1535 if (IS_ERR(dnew)) 1534 if (IS_ERR(dnew))
1536 goto out_nfserr; 1535 goto out_nfserr;
1537 1536
1538 mode = S_IALLUGO;
1539 /* Only the MODE ATTRibute is even vaguely meaningful */
1540 if (iap && (iap->ia_valid & ATTR_MODE))
1541 mode = iap->ia_mode & S_IALLUGO;
1542
1543 host_err = mnt_want_write(fhp->fh_export->ex_path.mnt); 1537 host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
1544 if (host_err) 1538 if (host_err)
1545 goto out_nfserr; 1539 goto out_nfserr;
@@ -1551,11 +1545,11 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
1551 else { 1545 else {
1552 strncpy(path_alloced, path, plen); 1546 strncpy(path_alloced, path, plen);
1553 path_alloced[plen] = 0; 1547 path_alloced[plen] = 0;
1554 host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode); 1548 host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced);
1555 kfree(path_alloced); 1549 kfree(path_alloced);
1556 } 1550 }
1557 } else 1551 } else
1558 host_err = vfs_symlink(dentry->d_inode, dnew, path, mode); 1552 host_err = vfs_symlink(dentry->d_inode, dnew, path);
1559 1553
1560 if (!host_err) { 1554 if (!host_err) {
1561 if (EX_ISSYNC(fhp->fh_export)) 1555 if (EX_ISSYNC(fhp->fh_export))
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1a3546e69f9e..25998e803fc2 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1139,7 +1139,7 @@ extern int vfs_permission(struct nameidata *, int);
1139extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); 1139extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
1140extern int vfs_mkdir(struct inode *, struct dentry *, int); 1140extern int vfs_mkdir(struct inode *, struct dentry *, int);
1141extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); 1141extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
1142extern int vfs_symlink(struct inode *, struct dentry *, const char *, int); 1142extern int vfs_symlink(struct inode *, struct dentry *, const char *);
1143extern int vfs_link(struct dentry *, struct inode *, struct dentry *); 1143extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
1144extern int vfs_rmdir(struct inode *, struct dentry *); 1144extern int vfs_rmdir(struct inode *, struct dentry *);
1145extern int vfs_unlink(struct inode *, struct dentry *); 1145extern int vfs_unlink(struct inode *, struct dentry *);