diff options
| author | Alex Elder <aelder@sgi.com> | 2009-10-08 14:53:44 -0400 |
|---|---|---|
| committer | Alex Elder <aelder@sgi.com> | 2009-10-08 14:53:44 -0400 |
| commit | e09d39968bd8befa087f10f970fa236e8694b643 (patch) | |
| tree | 393f4cdd32504ed435b7a5f728cf74855378459d /fs/xfs/xfs_dir2_leaf.c | |
| parent | fdec29c5fcd2705d61c1d14a1d4c74be03e9627c (diff) | |
| parent | d0800703febc04827b8fa91921aa4e254d01e8d1 (diff) | |
Merge branch 'master' into for-linus
Diffstat (limited to 'fs/xfs/xfs_dir2_leaf.c')
| -rw-r--r-- | fs/xfs/xfs_dir2_leaf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c index fa913e459442..41ad537c49e9 100644 --- a/fs/xfs/xfs_dir2_leaf.c +++ b/fs/xfs/xfs_dir2_leaf.c | |||
| @@ -854,6 +854,7 @@ xfs_dir2_leaf_getdents( | |||
| 854 | */ | 854 | */ |
| 855 | ra_want = howmany(bufsize + mp->m_dirblksize, | 855 | ra_want = howmany(bufsize + mp->m_dirblksize, |
| 856 | mp->m_sb.sb_blocksize) - 1; | 856 | mp->m_sb.sb_blocksize) - 1; |
| 857 | ASSERT(ra_want >= 0); | ||
| 857 | 858 | ||
| 858 | /* | 859 | /* |
| 859 | * If we don't have as many as we want, and we haven't | 860 | * If we don't have as many as we want, and we haven't |
| @@ -1088,7 +1089,8 @@ xfs_dir2_leaf_getdents( | |||
| 1088 | */ | 1089 | */ |
| 1089 | ptr += length; | 1090 | ptr += length; |
| 1090 | curoff += length; | 1091 | curoff += length; |
| 1091 | bufsize -= length; | 1092 | /* bufsize may have just been a guess; don't go negative */ |
| 1093 | bufsize = bufsize > length ? bufsize - length : 0; | ||
| 1092 | } | 1094 | } |
| 1093 | 1095 | ||
| 1094 | /* | 1096 | /* |
