diff options
author | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
commit | cb5629b10d64a8006622ce3a52bc887d91057d69 (patch) | |
tree | 7c06d8f30783115e3384721046258ce615b129c5 /fs/ext2/ialloc.c | |
parent | 8920d5ad6ba74ae8ab020e90cc4d976980e68701 (diff) | |
parent | f01d1d546abb2f4028b5299092f529eefb01253a (diff) |
Merge branch 'master' into next
Conflicts:
fs/namei.c
Manually merged per:
diff --cc fs/namei.c
index 734f2b5,bbc15c2..0000000
--- a/fs/namei.c
+++ b/fs/namei.c
@@@ -860,9 -848,8 +849,10 @@@ static int __link_path_walk(const char
nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode);
if (err == -EAGAIN)
- err = vfs_permission(nd, MAY_EXEC);
+ err = inode_permission(nd->path.dentry->d_inode,
+ MAY_EXEC);
+ if (!err)
+ err = ima_path_check(&nd->path, MAY_EXEC);
if (err)
break;
@@@ -1525,14 -1506,9 +1509,14 @@@ int may_open(struct path *path, int acc
flag &= ~O_TRUNC;
}
- error = vfs_permission(nd, acc_mode);
+ error = inode_permission(inode, acc_mode);
if (error)
return error;
+
- error = ima_path_check(&nd->path,
++ error = ima_path_check(path,
+ acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
+ if (error)
+ return error;
/*
* An append-only file must be opened in append mode for writing.
*/
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/ext2/ialloc.c')
-rw-r--r-- | fs/ext2/ialloc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index 8d0add625870..66321a877e74 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c | |||
@@ -565,12 +565,8 @@ got: | |||
565 | inode->i_blocks = 0; | 565 | inode->i_blocks = 0; |
566 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; | 566 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; |
567 | memset(ei->i_data, 0, sizeof(ei->i_data)); | 567 | memset(ei->i_data, 0, sizeof(ei->i_data)); |
568 | ei->i_flags = EXT2_I(dir)->i_flags & ~EXT2_BTREE_FL; | 568 | ei->i_flags = |
569 | if (S_ISLNK(mode)) | 569 | ext2_mask_flags(mode, EXT2_I(dir)->i_flags & EXT2_FL_INHERITED); |
570 | ei->i_flags &= ~(EXT2_IMMUTABLE_FL|EXT2_APPEND_FL); | ||
571 | /* dirsync is only applied to directories */ | ||
572 | if (!S_ISDIR(mode)) | ||
573 | ei->i_flags &= ~EXT2_DIRSYNC_FL; | ||
574 | ei->i_faddr = 0; | 570 | ei->i_faddr = 0; |
575 | ei->i_frag_no = 0; | 571 | ei->i_frag_no = 0; |
576 | ei->i_frag_size = 0; | 572 | ei->i_frag_size = 0; |
@@ -585,7 +581,10 @@ got: | |||
585 | spin_lock(&sbi->s_next_gen_lock); | 581 | spin_lock(&sbi->s_next_gen_lock); |
586 | inode->i_generation = sbi->s_next_generation++; | 582 | inode->i_generation = sbi->s_next_generation++; |
587 | spin_unlock(&sbi->s_next_gen_lock); | 583 | spin_unlock(&sbi->s_next_gen_lock); |
588 | insert_inode_hash(inode); | 584 | if (insert_inode_locked(inode) < 0) { |
585 | err = -EINVAL; | ||
586 | goto fail_drop; | ||
587 | } | ||
589 | 588 | ||
590 | if (DQUOT_ALLOC_INODE(inode)) { | 589 | if (DQUOT_ALLOC_INODE(inode)) { |
591 | err = -EDQUOT; | 590 | err = -EDQUOT; |
@@ -612,6 +611,7 @@ fail_drop: | |||
612 | DQUOT_DROP(inode); | 611 | DQUOT_DROP(inode); |
613 | inode->i_flags |= S_NOQUOTA; | 612 | inode->i_flags |= S_NOQUOTA; |
614 | inode->i_nlink = 0; | 613 | inode->i_nlink = 0; |
614 | unlock_new_inode(inode); | ||
615 | iput(inode); | 615 | iput(inode); |
616 | return ERR_PTR(err); | 616 | return ERR_PTR(err); |
617 | 617 | ||