tree f4528809d197fc687a73b8152fab8356540455ba
parent bcec2b7f2bf856bdf2a8780a57fe78417a513682
author David Chinner <[EMAIL PROTECTED]> Fri, 02 Sep 2005 16:40:47 +1000
committer Nathan Scott <[EMAIL PROTECTED]> Fri, 02 Sep 2005 16:40:47 +1000

[XFS] Prevent the incore superblock sb_fdblocks count from leaking when 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 <[EMAIL PROTECTED]>
Signed-off-by: Nathan Scott <[EMAIL PROTECTED]>

 fs/xfs/xfs_bmap.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -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))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to