Skip to content

Commit

Permalink
[XFS] Prevent the incore superblock sb_fdblocks count from leaking wh…
Browse files Browse the repository at this point in the history
…en we

are getting ENOSPC errors on writes. When we fail to allocate space for
indirect blocks in xfs_bmapi() make sure we release the direct block
allocation before returning.

SGI-PV: 938502
SGI-Modid: xfs-linux:xfs-kern:22986a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
  • Loading branch information
David Chinner authored and Nathan Scott committed Sep 2, 2005
1 parent bcec2b7 commit 3bdbfb1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion fs/xfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4754,10 +4754,20 @@ xfs_bmapi(
error = xfs_mod_incore_sb(mp,
XFS_SBS_FDBLOCKS,
-(alen), rsvd);
if (!error)
if (!error) {
error = xfs_mod_incore_sb(mp,
XFS_SBS_FDBLOCKS,
-(indlen), rsvd);
if (error && rt) {
xfs_mod_incore_sb(ip->i_mount,
XFS_SBS_FREXTENTS,
extsz, rsvd);
} else if (error) {
xfs_mod_incore_sb(ip->i_mount,
XFS_SBS_FDBLOCKS,
alen, rsvd);
}
}

if (error) {
if (XFS_IS_QUOTA_ON(ip->i_mount))
Expand Down

0 comments on commit 3bdbfb1

Please sign in to comment.