diff options
Diffstat (limited to 'fs/xfs/xfs_iops.c')
-rw-r--r-- | fs/xfs/xfs_iops.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index c69bbc493cb0..96dda62d497b 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -467,9 +467,6 @@ xfs_setattr_mode( | |||
467 | ASSERT(tp); | 467 | ASSERT(tp); |
468 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); | 468 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
469 | 469 | ||
470 | if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) | ||
471 | mode &= ~S_ISGID; | ||
472 | |||
473 | ip->i_d.di_mode &= S_IFMT; | 470 | ip->i_d.di_mode &= S_IFMT; |
474 | ip->i_d.di_mode |= mode & ~S_IFMT; | 471 | ip->i_d.di_mode |= mode & ~S_IFMT; |
475 | 472 | ||
@@ -495,15 +492,18 @@ xfs_setattr_nonsize( | |||
495 | 492 | ||
496 | trace_xfs_setattr(ip); | 493 | trace_xfs_setattr(ip); |
497 | 494 | ||
498 | if (mp->m_flags & XFS_MOUNT_RDONLY) | 495 | /* If acls are being inherited, we already have this checked */ |
499 | return XFS_ERROR(EROFS); | 496 | if (!(flags & XFS_ATTR_NOACL)) { |
497 | if (mp->m_flags & XFS_MOUNT_RDONLY) | ||
498 | return XFS_ERROR(EROFS); | ||
500 | 499 | ||
501 | if (XFS_FORCED_SHUTDOWN(mp)) | 500 | if (XFS_FORCED_SHUTDOWN(mp)) |
502 | return XFS_ERROR(EIO); | 501 | return XFS_ERROR(EIO); |
503 | 502 | ||
504 | error = -inode_change_ok(inode, iattr); | 503 | error = -inode_change_ok(inode, iattr); |
505 | if (error) | 504 | if (error) |
506 | return XFS_ERROR(error); | 505 | return XFS_ERROR(error); |
506 | } | ||
507 | 507 | ||
508 | ASSERT((mask & ATTR_SIZE) == 0); | 508 | ASSERT((mask & ATTR_SIZE) == 0); |
509 | 509 | ||
@@ -539,7 +539,7 @@ xfs_setattr_nonsize( | |||
539 | ASSERT(udqp == NULL); | 539 | ASSERT(udqp == NULL); |
540 | ASSERT(gdqp == NULL); | 540 | ASSERT(gdqp == NULL); |
541 | error = xfs_qm_vop_dqalloc(ip, uid, gid, xfs_get_projid(ip), | 541 | error = xfs_qm_vop_dqalloc(ip, uid, gid, xfs_get_projid(ip), |
542 | qflags, &udqp, &gdqp); | 542 | qflags, &udqp, &gdqp, NULL); |
543 | if (error) | 543 | if (error) |
544 | return error; | 544 | return error; |
545 | } | 545 | } |
@@ -575,7 +575,7 @@ xfs_setattr_nonsize( | |||
575 | (XFS_IS_GQUOTA_ON(mp) && igid != gid))) { | 575 | (XFS_IS_GQUOTA_ON(mp) && igid != gid))) { |
576 | ASSERT(tp); | 576 | ASSERT(tp); |
577 | error = xfs_qm_vop_chown_reserve(tp, ip, udqp, gdqp, | 577 | error = xfs_qm_vop_chown_reserve(tp, ip, udqp, gdqp, |
578 | capable(CAP_FOWNER) ? | 578 | NULL, capable(CAP_FOWNER) ? |
579 | XFS_QMOPT_FORCE_RES : 0); | 579 | XFS_QMOPT_FORCE_RES : 0); |
580 | if (error) /* out of quota */ | 580 | if (error) /* out of quota */ |
581 | goto out_trans_cancel; | 581 | goto out_trans_cancel; |