Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232666
b: refs/heads/master
c: 5315837
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Alex Elder committed Jan 28, 2011
1 parent 6ea2bef commit 500e3a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ce159890c00e2cc705e955a939bf1dca7b07ab8
refs/heads/master: 5315837daee7ed76c31ef643915f7d76ef8c1aa3
20 changes: 18 additions & 2 deletions trunk/fs/xfs/linux-2.6/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,22 @@ xfs_ioctl_setattr(

/*
* Extent size must be a multiple of the appropriate block
* size, if set at all.
* size, if set at all. It must also be smaller than the
* maximum extent size supported by the filesystem.
*
* Also, for non-realtime files, limit the extent size hint to
* half the size of the AGs in the filesystem so alignment
* doesn't result in extents larger than an AG.
*/
if (fa->fsx_extsize != 0) {
xfs_extlen_t size;
xfs_extlen_t size;
xfs_fsblock_t extsize_fsb;

extsize_fsb = XFS_B_TO_FSB(mp, fa->fsx_extsize);
if (extsize_fsb > MAXEXTLEN) {
code = XFS_ERROR(EINVAL);
goto error_return;
}

if (XFS_IS_REALTIME_INODE(ip) ||
((mask & FSX_XFLAGS) &&
Expand All @@ -997,6 +1009,10 @@ xfs_ioctl_setattr(
mp->m_sb.sb_blocklog;
} else {
size = mp->m_sb.sb_blocksize;
if (extsize_fsb > mp->m_sb.sb_agblocks / 2) {
code = XFS_ERROR(EINVAL);
goto error_return;
}
}

if (fa->fsx_extsize % size) {
Expand Down

0 comments on commit 500e3a2

Please sign in to comment.