diff options
author | Brian Behlendorf <[email protected]> | 2011-05-19 12:47:32 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-07-01 12:40:08 -0700 |
commit | 5c03efc379693f992ebe39c6a00c7297c4a304ea (patch) | |
tree | 276b91b77f0fcd1c09774dcdc8b8d831b54be729 /module/zfs/zfs_znode.c | |
parent | bd2f5ac97f4265523fb1397d845eabb8647c79e4 (diff) |
Linux compat 2.6.39: security_inode_init_security()
The security_inode_init_security() function now takes an additional
qstr argument which must be passed in from the dentry if available.
Passing a NULL is safe when no qstr is available the relevant
security checks will just be skipped.
Closes #246
Closes #217
Closes #187
Diffstat (limited to 'module/zfs/zfs_znode.c')
-rw-r--r-- | module/zfs/zfs_znode.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index 17a5821eb..076161a85 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -327,7 +327,7 @@ zfs_inode_set_ops(zfs_sb_t *zsb, struct inode *ip) static znode_t * zfs_znode_alloc(zfs_sb_t *zsb, dmu_buf_t *db, int blksz, dmu_object_type_t obj_type, uint64_t obj, sa_handle_t *hdl, - struct dentry *dentry) + struct dentry *dentry, struct inode *dip) { znode_t *zp; struct inode *ip; @@ -383,8 +383,12 @@ zfs_znode_alloc(zfs_sb_t *zsb, dmu_buf_t *db, int blksz, if (insert_inode_locked(ip)) goto error; - if (dentry) + if (dentry) { + if (zpl_xattr_security_init(ip, dip, &dentry->d_name)) + goto error; + d_instantiate(dentry, ip); + } mutex_enter(&zsb->z_znodes_lock); list_insert_tail(&zsb->z_all_znodes, zp); @@ -681,11 +685,9 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr, if (!(flag & IS_ROOT_NODE)) { *zpp = zfs_znode_alloc(zsb, db, 0, obj_type, obj, sa_hdl, - vap->va_dentry); + vap->va_dentry, ZTOI(dzp)); ASSERT(*zpp != NULL); ASSERT(dzp != NULL); - err = zpl_xattr_security_init(ZTOI(*zpp), ZTOI(dzp)); - ASSERT3S(err, ==, 0); } else { /* * If we are creating the root node, the "parent" we @@ -894,7 +896,7 @@ again: * bonus buffer. */ zp = zfs_znode_alloc(zsb, db, doi.doi_data_block_size, - doi.doi_bonus_type, obj_num, NULL, NULL); + doi.doi_bonus_type, obj_num, NULL, NULL, NULL); if (zp == NULL) { err = ENOENT; } else { |