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/xfs/xfs_inode.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/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 5a5e035e5d38..e7ae08d1df48 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -424,6 +424,19 @@ xfs_iformat( | |||
424 | case XFS_DINODE_FMT_LOCAL: | 424 | case XFS_DINODE_FMT_LOCAL: |
425 | atp = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); | 425 | atp = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); |
426 | size = be16_to_cpu(atp->hdr.totsize); | 426 | size = be16_to_cpu(atp->hdr.totsize); |
427 | |||
428 | if (unlikely(size < sizeof(struct xfs_attr_sf_hdr))) { | ||
429 | xfs_fs_repair_cmn_err(CE_WARN, ip->i_mount, | ||
430 | "corrupt inode %Lu " | ||
431 | "(bad attr fork size %Ld).", | ||
432 | (unsigned long long) ip->i_ino, | ||
433 | (long long) size); | ||
434 | XFS_CORRUPTION_ERROR("xfs_iformat(8)", | ||
435 | XFS_ERRLEVEL_LOW, | ||
436 | ip->i_mount, dip); | ||
437 | return XFS_ERROR(EFSCORRUPTED); | ||
438 | } | ||
439 | |||
427 | error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, size); | 440 | error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, size); |
428 | break; | 441 | break; |
429 | case XFS_DINODE_FMT_EXTENTS: | 442 | case XFS_DINODE_FMT_EXTENTS: |
@@ -1601,10 +1614,10 @@ xfs_itruncate_finish( | |||
1601 | * in this file with garbage in them once recovery | 1614 | * in this file with garbage in them once recovery |
1602 | * runs. | 1615 | * runs. |
1603 | */ | 1616 | */ |
1604 | XFS_BMAP_INIT(&free_list, &first_block); | 1617 | xfs_bmap_init(&free_list, &first_block); |
1605 | error = xfs_bunmapi(ntp, ip, | 1618 | error = xfs_bunmapi(ntp, ip, |
1606 | first_unmap_block, unmap_len, | 1619 | first_unmap_block, unmap_len, |
1607 | XFS_BMAPI_AFLAG(fork) | | 1620 | xfs_bmapi_aflag(fork) | |
1608 | (sync ? 0 : XFS_BMAPI_ASYNC), | 1621 | (sync ? 0 : XFS_BMAPI_ASYNC), |
1609 | XFS_ITRUNC_MAX_EXTENTS, | 1622 | XFS_ITRUNC_MAX_EXTENTS, |
1610 | &first_block, &free_list, | 1623 | &first_block, &free_list, |
@@ -2557,7 +2570,7 @@ xfs_iextents_copy( | |||
2557 | for (i = 0; i < nrecs; i++) { | 2570 | for (i = 0; i < nrecs; i++) { |
2558 | xfs_bmbt_rec_host_t *ep = xfs_iext_get_ext(ifp, i); | 2571 | xfs_bmbt_rec_host_t *ep = xfs_iext_get_ext(ifp, i); |
2559 | start_block = xfs_bmbt_get_startblock(ep); | 2572 | start_block = xfs_bmbt_get_startblock(ep); |
2560 | if (ISNULLSTARTBLOCK(start_block)) { | 2573 | if (isnullstartblock(start_block)) { |
2561 | /* | 2574 | /* |
2562 | * It's a delayed allocation extent, so skip it. | 2575 | * It's a delayed allocation extent, so skip it. |
2563 | */ | 2576 | */ |