Skip to content

Commit

Permalink
xfs: Disallow 32bit project quota id
Browse files Browse the repository at this point in the history
Currently on-disk structure is able to keep only 16bit project quota
id, so disallow 32bit ones. This fixes a problem where parts of
kernel structures holding project quota id are 32bit while parts
(on-disk) are 16bit variables which causes project quota member
files to be inaccessible for some operations (like mv/rm).

Signed-off-by: Arkadiusz Mi?kiewicz <arekm@maven.pl>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
  • Loading branch information
Arkadiusz Mi?kiewicz authored and Alex Elder committed Sep 2, 2010
1 parent 2bfc96a commit 23963e5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/xfs/linux-2.6/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,13 @@ xfs_ioctl_setattr(
if (XFS_FORCED_SHUTDOWN(mp))
return XFS_ERROR(EIO);

/*
* Disallow 32bit project ids because on-disk structure
* is 16bit only.
*/
if ((mask & FSX_PROJID) && (fa->fsx_projid > (__uint16_t)-1))
return XFS_ERROR(EINVAL);

/*
* If disk quotas is on, we make sure that the dquots do exist on disk,
* before we start any other transactions. Trying to do this later
Expand Down

0 comments on commit 23963e5

Please sign in to comment.