aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/inode.c')
-rw-r--r--fs/ocfs2/inode.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 88459bdd1ff3..ab207901d32a 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -665,7 +665,7 @@ static int ocfs2_remove_inode(struct inode *inode,
665 } 665 }
666 666
667 ocfs2_remove_from_cache(INODE_CACHE(inode), di_bh); 667 ocfs2_remove_from_cache(INODE_CACHE(inode), di_bh);
668 vfs_dq_free_inode(inode); 668 dquot_free_inode(inode);
669 669
670 status = ocfs2_free_dinode(handle, inode_alloc_inode, 670 status = ocfs2_free_dinode(handle, inode_alloc_inode,
671 inode_alloc_bh, di); 671 inode_alloc_bh, di);
@@ -891,6 +891,21 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
891 /* Do some basic inode verification... */ 891 /* Do some basic inode verification... */
892 di = (struct ocfs2_dinode *) di_bh->b_data; 892 di = (struct ocfs2_dinode *) di_bh->b_data;
893 if (!(di->i_flags & cpu_to_le32(OCFS2_ORPHANED_FL))) { 893 if (!(di->i_flags & cpu_to_le32(OCFS2_ORPHANED_FL))) {
894 /*
895 * Inodes in the orphan dir must have ORPHANED_FL. The only
896 * inodes that come back out of the orphan dir are reflink
897 * targets. A reflink target may be moved out of the orphan
898 * dir between the time we scan the directory and the time we
899 * process it. This would lead to HAS_REFCOUNT_FL being set but
900 * ORPHANED_FL not.
901 */
902 if (di->i_dyn_features & cpu_to_le16(OCFS2_HAS_REFCOUNT_FL)) {
903 mlog(0, "Reflinked inode %llu is no longer orphaned. "
904 "it shouldn't be deleted\n",
905 (unsigned long long)oi->ip_blkno);
906 goto bail;
907 }
908
894 /* for lack of a better error? */ 909 /* for lack of a better error? */
895 status = -EEXIST; 910 status = -EEXIST;
896 mlog(ML_ERROR, 911 mlog(ML_ERROR,
@@ -971,6 +986,8 @@ void ocfs2_delete_inode(struct inode *inode)
971 goto bail; 986 goto bail;
972 } 987 }
973 988
989 dquot_initialize(inode);
990
974 if (!ocfs2_inode_is_valid_to_delete(inode)) { 991 if (!ocfs2_inode_is_valid_to_delete(inode)) {
975 /* It's probably not necessary to truncate_inode_pages 992 /* It's probably not necessary to truncate_inode_pages
976 * here but we do it for safety anyway (it will most 993 * here but we do it for safety anyway (it will most
@@ -1087,6 +1104,8 @@ void ocfs2_clear_inode(struct inode *inode)
1087 mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, 1104 mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL,
1088 "Inode=%lu\n", inode->i_ino); 1105 "Inode=%lu\n", inode->i_ino);
1089 1106
1107 dquot_drop(inode);
1108
1090 /* To preven remote deletes we hold open lock before, now it 1109 /* To preven remote deletes we hold open lock before, now it
1091 * is time to unlock PR and EX open locks. */ 1110 * is time to unlock PR and EX open locks. */
1092 ocfs2_open_unlock(inode); 1111 ocfs2_open_unlock(inode);