diff options
Diffstat (limited to 'fs/ocfs2/inode.c')
-rw-r--r-- | fs/ocfs2/inode.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 0297fb8982b8..07cc8bb68b6d 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -25,7 +25,6 @@ | |||
25 | 25 | ||
26 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/slab.h> | ||
29 | #include <linux/highmem.h> | 28 | #include <linux/highmem.h> |
30 | #include <linux/pagemap.h> | 29 | #include <linux/pagemap.h> |
31 | #include <linux/quotaops.h> | 30 | #include <linux/quotaops.h> |
@@ -475,7 +474,7 @@ static int ocfs2_read_locked_inode(struct inode *inode, | |||
475 | if (args->fi_flags & OCFS2_FI_FLAG_ORPHAN_RECOVERY) { | 474 | if (args->fi_flags & OCFS2_FI_FLAG_ORPHAN_RECOVERY) { |
476 | status = ocfs2_try_open_lock(inode, 0); | 475 | status = ocfs2_try_open_lock(inode, 0); |
477 | if (status) { | 476 | if (status) { |
478 | make_bad_inode(inode); | 477 | make_bad_inode(inode); |
479 | return status; | 478 | return status; |
480 | } | 479 | } |
481 | } | 480 | } |
@@ -665,7 +664,7 @@ static int ocfs2_remove_inode(struct inode *inode, | |||
665 | } | 664 | } |
666 | 665 | ||
667 | ocfs2_remove_from_cache(INODE_CACHE(inode), di_bh); | 666 | ocfs2_remove_from_cache(INODE_CACHE(inode), di_bh); |
668 | vfs_dq_free_inode(inode); | 667 | dquot_free_inode(inode); |
669 | 668 | ||
670 | status = ocfs2_free_dinode(handle, inode_alloc_inode, | 669 | status = ocfs2_free_dinode(handle, inode_alloc_inode, |
671 | inode_alloc_bh, di); | 670 | inode_alloc_bh, di); |
@@ -684,7 +683,7 @@ bail: | |||
684 | return status; | 683 | return status; |
685 | } | 684 | } |
686 | 685 | ||
687 | /* | 686 | /* |
688 | * Serialize with orphan dir recovery. If the process doing | 687 | * Serialize with orphan dir recovery. If the process doing |
689 | * recovery on this orphan dir does an iget() with the dir | 688 | * recovery on this orphan dir does an iget() with the dir |
690 | * i_mutex held, we'll deadlock here. Instead we detect this | 689 | * i_mutex held, we'll deadlock here. Instead we detect this |
@@ -891,6 +890,21 @@ static int ocfs2_query_inode_wipe(struct inode *inode, | |||
891 | /* Do some basic inode verification... */ | 890 | /* Do some basic inode verification... */ |
892 | di = (struct ocfs2_dinode *) di_bh->b_data; | 891 | di = (struct ocfs2_dinode *) di_bh->b_data; |
893 | if (!(di->i_flags & cpu_to_le32(OCFS2_ORPHANED_FL))) { | 892 | if (!(di->i_flags & cpu_to_le32(OCFS2_ORPHANED_FL))) { |
893 | /* | ||
894 | * Inodes in the orphan dir must have ORPHANED_FL. The only | ||
895 | * inodes that come back out of the orphan dir are reflink | ||
896 | * targets. A reflink target may be moved out of the orphan | ||
897 | * dir between the time we scan the directory and the time we | ||
898 | * process it. This would lead to HAS_REFCOUNT_FL being set but | ||
899 | * ORPHANED_FL not. | ||
900 | */ | ||
901 | if (di->i_dyn_features & cpu_to_le16(OCFS2_HAS_REFCOUNT_FL)) { | ||
902 | mlog(0, "Reflinked inode %llu is no longer orphaned. " | ||
903 | "it shouldn't be deleted\n", | ||
904 | (unsigned long long)oi->ip_blkno); | ||
905 | goto bail; | ||
906 | } | ||
907 | |||
894 | /* for lack of a better error? */ | 908 | /* for lack of a better error? */ |
895 | status = -EEXIST; | 909 | status = -EEXIST; |
896 | mlog(ML_ERROR, | 910 | mlog(ML_ERROR, |
@@ -971,6 +985,8 @@ void ocfs2_delete_inode(struct inode *inode) | |||
971 | goto bail; | 985 | goto bail; |
972 | } | 986 | } |
973 | 987 | ||
988 | dquot_initialize(inode); | ||
989 | |||
974 | if (!ocfs2_inode_is_valid_to_delete(inode)) { | 990 | if (!ocfs2_inode_is_valid_to_delete(inode)) { |
975 | /* It's probably not necessary to truncate_inode_pages | 991 | /* It's probably not necessary to truncate_inode_pages |
976 | * here but we do it for safety anyway (it will most | 992 | * here but we do it for safety anyway (it will most |
@@ -1087,6 +1103,8 @@ void ocfs2_clear_inode(struct inode *inode) | |||
1087 | mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, | 1103 | mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, |
1088 | "Inode=%lu\n", inode->i_ino); | 1104 | "Inode=%lu\n", inode->i_ino); |
1089 | 1105 | ||
1106 | dquot_drop(inode); | ||
1107 | |||
1090 | /* To preven remote deletes we hold open lock before, now it | 1108 | /* To preven remote deletes we hold open lock before, now it |
1091 | * is time to unlock PR and EX open locks. */ | 1109 | * is time to unlock PR and EX open locks. */ |
1092 | ocfs2_open_unlock(inode); | 1110 | ocfs2_open_unlock(inode); |