Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFS: Remove the nfs4_label argument from nfs_setsecurity

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Anna Schumaker and committed by
Trond Myklebust
dd225cb3 cf7ab00a

+17 -22
+2 -3
fs/nfs/dir.c
··· 682 682 nfs_set_verifier(dentry, dir_verifier); 683 683 status = nfs_refresh_inode(d_inode(dentry), entry->fattr); 684 684 if (!status) 685 - nfs_setsecurity(d_inode(dentry), entry->fattr, 686 - entry->fattr->label); 685 + nfs_setsecurity(d_inode(dentry), entry->fattr); 687 686 goto out; 688 687 } else { 689 688 d_invalidate(dentry); ··· 1522 1523 if (nfs_refresh_inode(inode, fattr) < 0) 1523 1524 goto out; 1524 1525 1525 - nfs_setsecurity(inode, fattr, fattr->label); 1526 + nfs_setsecurity(inode, fattr); 1526 1527 nfs_set_verifier(dentry, dir_verifier); 1527 1528 1528 1529 /* set a readdirplus hint that we had a cache miss */
+1 -1
fs/nfs/getroot.c
··· 148 148 !(kflags_out & SECURITY_LSM_NATIVE_LABELS)) 149 149 server->caps &= ~NFS_CAP_SECURITY_LABEL; 150 150 151 - nfs_setsecurity(inode, fsinfo.fattr, fsinfo.fattr->label); 151 + nfs_setsecurity(inode, fsinfo.fattr); 152 152 error = 0; 153 153 154 154 out_fattr:
+9 -11
fs/nfs/inode.c
··· 355 355 spin_unlock(&inode->i_lock); 356 356 } 357 357 358 - void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr, 359 - struct nfs4_label *label) 358 + void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr) 360 359 { 361 360 int error; 362 361 363 - if (label == NULL) 362 + if (fattr->label == NULL) 364 363 return; 365 364 366 365 if ((fattr->valid & NFS_ATTR_FATTR_V4_SECURITY_LABEL) && inode->i_security) { 367 - error = security_inode_notifysecctx(inode, label->label, 368 - label->len); 366 + error = security_inode_notifysecctx(inode, fattr->label->label, 367 + fattr->label->len); 369 368 if (error) 370 369 printk(KERN_ERR "%s() %s %d " 371 370 "security_inode_notifysecctx() %d\n", 372 371 __func__, 373 - (char *)label->label, 374 - label->len, error); 372 + (char *)fattr->label->label, 373 + fattr->label->len, error); 375 374 nfs_clear_label_invalid(inode); 376 375 } 377 376 } ··· 397 398 } 398 399 EXPORT_SYMBOL_GPL(nfs4_label_alloc); 399 400 #else 400 - void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr, 401 - struct nfs4_label *label) 401 + void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr) 402 402 { 403 403 } 404 404 #endif ··· 579 581 fattr->size != 0) 580 582 nfs_set_cache_invalid(inode, NFS_INO_INVALID_BLOCKS); 581 583 582 - nfs_setsecurity(inode, fattr, fattr->label); 584 + nfs_setsecurity(inode, fattr); 583 585 584 586 nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); 585 587 nfsi->attrtimeo_timestamp = now; ··· 1250 1252 if (nfsi->cache_validity & NFS_INO_INVALID_ACL) 1251 1253 nfs_zap_acl_cache(inode); 1252 1254 1253 - nfs_setsecurity(inode, fattr, fattr->label); 1255 + nfs_setsecurity(inode, fattr); 1254 1256 1255 1257 dfprintk(PAGECACHE, "NFS: (%s/%Lu) revalidation complete\n", 1256 1258 inode->i_sb->s_id,
+4 -5
fs/nfs/nfs4proc.c
··· 3179 3179 if (status == 0) { 3180 3180 nfs_setattr_update_inode(state->inode, sattr, 3181 3181 opendata->o_res.f_attr); 3182 - nfs_setsecurity(state->inode, opendata->o_res.f_attr, 3183 - opendata->o_res.f_attr->label); 3182 + nfs_setsecurity(state->inode, opendata->o_res.f_attr); 3184 3183 } 3185 3184 sattr->ia_valid = ia_old; 3186 3185 } ··· 4260 4261 status = nfs4_do_setattr(inode, cred, fattr, sattr, ctx, NULL); 4261 4262 if (status == 0) { 4262 4263 nfs_setattr_update_inode(inode, sattr, fattr); 4263 - nfs_setsecurity(inode, fattr, fattr->label); 4264 + nfs_setsecurity(inode, fattr); 4264 4265 } 4265 4266 return status; 4266 4267 } ··· 4781 4782 nfs4_inc_nlink(inode); 4782 4783 status = nfs_post_op_update_inode(inode, res.fattr); 4783 4784 if (!status) 4784 - nfs_setsecurity(inode, res.fattr, res.fattr->label); 4785 + nfs_setsecurity(inode, res.fattr); 4785 4786 } 4786 4787 4787 4788 out: ··· 6076 6077 6077 6078 status = nfs4_do_set_security_label(inode, &ilabel, fattr); 6078 6079 if (status == 0) 6079 - nfs_setsecurity(inode, fattr, fattr->label); 6080 + nfs_setsecurity(inode, fattr); 6080 6081 6081 6082 return status; 6082 6083 }
+1 -2
include/linux/nfs_fs.h
··· 409 409 extern int nfs_revalidate_mapping_rcu(struct inode *inode); 410 410 extern int nfs_setattr(struct user_namespace *, struct dentry *, struct iattr *); 411 411 extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, struct nfs_fattr *); 412 - extern void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr, 413 - struct nfs4_label *label); 412 + extern void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr); 414 413 extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 415 414 extern void put_nfs_open_context(struct nfs_open_context *ctx); 416 415 extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, const struct cred *cred, fmode_t mode);