aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorDavid Quigley <dpquigl@davequigley.com>2013-05-22 12:50:44 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-06-08 16:20:16 -0400
commitaa9c2669626ca7e5e5bab28e6caeb583fd40099b (patch)
tree632e008011b5a8b75edf5a2f4c3c0daf464f0cc4 /fs/nfs/dir.c
parent14c43f767818c42f91ec7ffa586ee975845f68c8 (diff)
NFS: Client implementation of Labeled-NFS
This patch implements the client transport and handling support for labeled NFS. The patch adds two functions to encode and decode the security label recommended attribute which makes use of the LSM hooks added earlier. It also adds code to grab the label from the file attribute structures and encode the label to be sent back to the server. Acked-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Matthew N. Dodd <Matthew.Dodd@sparta.com> Signed-off-by: Miguel Rodel Felipe <Rodel_FM@dsi.a-star.edu.sg> Signed-off-by: Phua Eu Gene <PHUA_Eu_Gene@dsi.a-star.edu.sg> Signed-off-by: Khin Mi Mi Aung <Mi_Mi_AUNG@dsi.a-star.edu.sg> Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 736b607ac8a8..743d3b524fc5 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -435,6 +435,7 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
435 struct dentry *alias; 435 struct dentry *alias;
436 struct inode *dir = parent->d_inode; 436 struct inode *dir = parent->d_inode;
437 struct inode *inode; 437 struct inode *inode;
438 int status;
438 439
439 if (filename.name[0] == '.') { 440 if (filename.name[0] == '.') {
440 if (filename.len == 1) 441 if (filename.len == 1)
@@ -447,7 +448,9 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
447 dentry = d_lookup(parent, &filename); 448 dentry = d_lookup(parent, &filename);
448 if (dentry != NULL) { 449 if (dentry != NULL) {
449 if (nfs_same_file(dentry, entry)) { 450 if (nfs_same_file(dentry, entry)) {
450 nfs_refresh_inode(dentry->d_inode, entry->fattr); 451 status = nfs_refresh_inode(dentry->d_inode, entry->fattr);
452 if (!status)
453 nfs_setsecurity(dentry->d_inode, entry->fattr, entry->label);
451 goto out; 454 goto out;
452 } else { 455 } else {
453 if (d_invalidate(dentry) != 0) 456 if (d_invalidate(dentry) != 0)
@@ -1103,6 +1106,8 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
1103 if ((error = nfs_refresh_inode(inode, fattr)) != 0) 1106 if ((error = nfs_refresh_inode(inode, fattr)) != 0)
1104 goto out_bad; 1107 goto out_bad;
1105 1108
1109 nfs_setsecurity(inode, fattr, label);
1110
1106 nfs_free_fattr(fattr); 1111 nfs_free_fattr(fattr);
1107 nfs_free_fhandle(fhandle); 1112 nfs_free_fhandle(fhandle);
1108 nfs4_label_free(label); 1113 nfs4_label_free(label);