Whamcloud - gitweb
LU-6722 ldiskfs: declare credits for quota when destroy inode
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel6.3 / ext4-back-dquot-to.patch
index e0bf364..f69a7c8 100644 (file)
@@ -58,41 +58,3 @@ Index: linux-stage/fs/ext4/super.c
        .alloc_space    = dquot_alloc_space,
        .reserve_space  = dquot_reserve_space,
        .claim_space    = dquot_claim_space,
-Index: linux-stage/fs/ext4/inode.c
-===================================================================
---- linux-stage.orig/fs/ext4/inode.c
-+++ linux-stage/fs/ext4/inode.c
-@@ -222,6 +222,7 @@ void ext4_delete_inode(struct inode *ino
- {
-       handle_t *handle;
-       int err;
-+      int extra_credits = 3;
-       if (ext4_should_order_data(inode))
-               ext4_begin_ordered_truncate(inode, 0);
-@@ -230,7 +231,10 @@ void ext4_delete_inode(struct inode *ino
-       if (is_bad_inode(inode))
-               goto no_delete;
--      handle = ext4_journal_start(inode, blocks_for_truncate(inode)+3);
-+      if (!IS_NOQUOTA(inode))
-+              extra_credits += 2 * EXT4_QUOTA_DEL_BLOCKS(inode->i_sb);
-+      handle = ext4_journal_start(inode,
-+                      blocks_for_truncate(inode) + extra_credits);
-       if (IS_ERR(handle)) {
-               ext4_std_error(inode->i_sb, PTR_ERR(handle));
-               /*
-@@ -266,10 +270,10 @@ void ext4_delete_inode(struct inode *ino
-        * enough credits left in the handle to remove the inode from
-        * the orphan list and set the dtime field.
-        */
--      if (!ext4_handle_has_enough_credits(handle, 3)) {
--              err = ext4_journal_extend(handle, 3);
-+      if (!ext4_handle_has_enough_credits(handle, extra_credits)) {
-+              err = ext4_journal_extend(handle, extra_credits);
-               if (err > 0)
--                      err = ext4_journal_restart(handle, 3);
-+                      err = ext4_journal_restart(handle, extra_credits);
-               if (err != 0) {
-                       ext4_warning(inode->i_sb,
-                                    "couldn't extend journal (err %d)", err);