mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
reiserfs: add atomic addition of selinux attributes during inode creation
Some time ago, some changes were made to make security inode attributes be atomically written during inode creation. ReiserFS fell behind in this area, but with the reworking of the xattr code, it's now fairly easy to add. The following patch adds the ability for security attributes to be added automatically during inode creation. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
a41f1a4715
commit
57fe60df62
5 changed files with 137 additions and 6 deletions
|
@ -1747,7 +1747,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
|
|||
/* 0 for regular, EMTRY_DIR_SIZE for dirs,
|
||||
strlen (symname) for symlinks) */
|
||||
loff_t i_size, struct dentry *dentry,
|
||||
struct inode *inode)
|
||||
struct inode *inode,
|
||||
struct reiserfs_security_handle *security)
|
||||
{
|
||||
struct super_block *sb;
|
||||
struct reiserfs_iget_args args;
|
||||
|
@ -1929,6 +1930,19 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
|
|||
} else if (IS_PRIVATE(dir))
|
||||
inode->i_flags |= S_PRIVATE;
|
||||
|
||||
if (security->name) {
|
||||
retval = reiserfs_security_write(th, inode, security);
|
||||
if (retval) {
|
||||
err = retval;
|
||||
reiserfs_check_path(&path_to_key);
|
||||
retval = journal_end(th, th->t_super,
|
||||
th->t_blocks_allocated);
|
||||
if (retval)
|
||||
err = retval;
|
||||
goto out_inserted_sd;
|
||||
}
|
||||
}
|
||||
|
||||
reiserfs_update_sd(th, inode);
|
||||
reiserfs_check_path(&path_to_key);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue