aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorDavid Quigley <dpquigl@davequigley.com>2013-05-22 12:50:43 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-06-08 16:20:15 -0400
commit14c43f767818c42f91ec7ffa586ee975845f68c8 (patch)
treee1f95f8344f144179d91c9531d83cd7de6684346 /fs/nfs/inode.c
parent1775fd3e805b6a852ef376256967de69284d7962 (diff)
NFS: Add label lifecycle management
This patch adds the lifecycle management for the security label structure introduced in an earlier patch. The label is not used yet but allocations and freeing of the structure is handled. 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/inode.c')
-rw-r--r--fs/nfs/inode.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 58e7bf876e6c..12e8ad85ae50 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -836,6 +836,13 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
836 goto out; 836 goto out;
837 837
838 nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE); 838 nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE);
839
840 label = nfs4_label_alloc(NFS_SERVER(inode), GFP_KERNEL);
841 if (IS_ERR(label)) {
842 status = PTR_ERR(label);
843 goto out;
844 }
845
839 status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), fattr, label); 846 status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), fattr, label);
840 if (status != 0) { 847 if (status != 0) {
841 dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n", 848 dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n",
@@ -846,7 +853,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
846 if (!S_ISDIR(inode->i_mode)) 853 if (!S_ISDIR(inode->i_mode))
847 set_bit(NFS_INO_STALE, &NFS_I(inode)->flags); 854 set_bit(NFS_INO_STALE, &NFS_I(inode)->flags);
848 } 855 }
849 goto out; 856 goto err_out;
850 } 857 }
851 858
852 status = nfs_refresh_inode(inode, fattr); 859 status = nfs_refresh_inode(inode, fattr);
@@ -854,7 +861,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
854 dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) refresh failed, error=%d\n", 861 dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) refresh failed, error=%d\n",
855 inode->i_sb->s_id, 862 inode->i_sb->s_id,
856 (long long)NFS_FILEID(inode), status); 863 (long long)NFS_FILEID(inode), status);
857 goto out; 864 goto err_out;
858 } 865 }
859 866
860 if (nfsi->cache_validity & NFS_INO_INVALID_ACL) 867 if (nfsi->cache_validity & NFS_INO_INVALID_ACL)
@@ -864,7 +871,9 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
864 inode->i_sb->s_id, 871 inode->i_sb->s_id,
865 (long long)NFS_FILEID(inode)); 872 (long long)NFS_FILEID(inode));
866 873
867 out: 874err_out:
875 nfs4_label_free(label);
876out:
868 nfs_free_fattr(fattr); 877 nfs_free_fattr(fattr);
869 return status; 878 return status;
870} 879}