Commit e216aeea authored by Nathan Scott's avatar Nathan Scott Committed by Nathan Scott

[XFS] Fix signed/unsigned issues in xfs_reserve_blocks routine.

SGI Modid: xfs-linux:xfs-kern:174873a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 7b5ad0c5
...@@ -507,7 +507,7 @@ xfs_reserve_blocks( ...@@ -507,7 +507,7 @@ xfs_reserve_blocks(
__uint64_t *inval, __uint64_t *inval,
xfs_fsop_resblks_t *outval) xfs_fsop_resblks_t *outval)
{ {
__uint64_t lcounter, delta; __int64_t lcounter, delta;
__uint64_t request; __uint64_t request;
unsigned long s; unsigned long s;
...@@ -536,8 +536,7 @@ xfs_reserve_blocks( ...@@ -536,8 +536,7 @@ xfs_reserve_blocks(
mp->m_resblks = request; mp->m_resblks = request;
} else { } else {
delta = request - mp->m_resblks; delta = request - mp->m_resblks;
lcounter = mp->m_sb.sb_fdblocks; lcounter = mp->m_sb.sb_fdblocks - delta;
lcounter -= delta;
if (lcounter < 0) { if (lcounter < 0) {
/* We can't satisfy the request, just get what we can */ /* We can't satisfy the request, just get what we can */
mp->m_resblks += mp->m_sb.sb_fdblocks; mp->m_resblks += mp->m_sb.sb_fdblocks;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment