diff options
Diffstat (limited to 'fs/ocfs2/inode.c')
-rw-r--r-- | fs/ocfs2/inode.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index ebb2bbe30f35..86cf073996b5 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -49,7 +49,6 @@ | |||
49 | #include "symlink.h" | 49 | #include "symlink.h" |
50 | #include "sysfile.h" | 50 | #include "sysfile.h" |
51 | #include "uptodate.h" | 51 | #include "uptodate.h" |
52 | #include "vote.h" | ||
53 | 52 | ||
54 | #include "buffer_head_io.h" | 53 | #include "buffer_head_io.h" |
55 | 54 | ||
@@ -718,8 +717,8 @@ static int ocfs2_wipe_inode(struct inode *inode, | |||
718 | } | 717 | } |
719 | 718 | ||
720 | /* we do this while holding the orphan dir lock because we | 719 | /* we do this while holding the orphan dir lock because we |
721 | * don't want recovery being run from another node to vote for | 720 | * don't want recovery being run from another node to try an |
722 | * an inode delete on us -- this will result in two nodes | 721 | * inode delete underneath us -- this will result in two nodes |
723 | * truncating the same file! */ | 722 | * truncating the same file! */ |
724 | status = ocfs2_truncate_for_delete(osb, inode, di_bh); | 723 | status = ocfs2_truncate_for_delete(osb, inode, di_bh); |
725 | if (status < 0) { | 724 | if (status < 0) { |
@@ -744,7 +743,7 @@ bail: | |||
744 | } | 743 | } |
745 | 744 | ||
746 | /* There is a series of simple checks that should be done before a | 745 | /* There is a series of simple checks that should be done before a |
747 | * vote is even considered. Encapsulate those in this function. */ | 746 | * trylock is even considered. Encapsulate those in this function. */ |
748 | static int ocfs2_inode_is_valid_to_delete(struct inode *inode) | 747 | static int ocfs2_inode_is_valid_to_delete(struct inode *inode) |
749 | { | 748 | { |
750 | int ret = 0; | 749 | int ret = 0; |
@@ -758,14 +757,14 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode) | |||
758 | goto bail; | 757 | goto bail; |
759 | } | 758 | } |
760 | 759 | ||
761 | /* If we're coming from process_vote we can't go into our own | 760 | /* If we're coming from downconvert_thread we can't go into our own |
762 | * voting [hello, deadlock city!], so unforuntately we just | 761 | * voting [hello, deadlock city!], so unforuntately we just |
763 | * have to skip deleting this guy. That's OK though because | 762 | * have to skip deleting this guy. That's OK though because |
764 | * the node who's doing the actual deleting should handle it | 763 | * the node who's doing the actual deleting should handle it |
765 | * anyway. */ | 764 | * anyway. */ |
766 | if (current == osb->vote_task) { | 765 | if (current == osb->dc_task) { |
767 | mlog(0, "Skipping delete of %lu because we're currently " | 766 | mlog(0, "Skipping delete of %lu because we're currently " |
768 | "in process_vote\n", inode->i_ino); | 767 | "in downconvert\n", inode->i_ino); |
769 | goto bail; | 768 | goto bail; |
770 | } | 769 | } |
771 | 770 | ||
@@ -779,10 +778,9 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode) | |||
779 | goto bail_unlock; | 778 | goto bail_unlock; |
780 | } | 779 | } |
781 | 780 | ||
782 | /* If we have voted "yes" on the wipe of this inode for | 781 | /* If we have allowd wipe of this inode for another node, it |
783 | * another node, it will be marked here so we can safely skip | 782 | * will be marked here so we can safely skip it. Recovery will |
784 | * it. Recovery will cleanup any inodes we might inadvertantly | 783 | * cleanup any inodes we might inadvertantly skip here. */ |
785 | * skip here. */ | ||
786 | if (oi->ip_flags & OCFS2_INODE_SKIP_DELETE) { | 784 | if (oi->ip_flags & OCFS2_INODE_SKIP_DELETE) { |
787 | mlog(0, "Skipping delete of %lu because another node " | 785 | mlog(0, "Skipping delete of %lu because another node " |
788 | "has done this for us.\n", inode->i_ino); | 786 | "has done this for us.\n", inode->i_ino); |
@@ -929,7 +927,7 @@ void ocfs2_delete_inode(struct inode *inode) | |||
929 | 927 | ||
930 | /* Lock down the inode. This gives us an up to date view of | 928 | /* Lock down the inode. This gives us an up to date view of |
931 | * it's metadata (for verification), and allows us to | 929 | * it's metadata (for verification), and allows us to |
932 | * serialize delete_inode votes. | 930 | * serialize delete_inode on multiple nodes. |
933 | * | 931 | * |
934 | * Even though we might be doing a truncate, we don't take the | 932 | * Even though we might be doing a truncate, we don't take the |
935 | * allocation lock here as it won't be needed - nobody will | 933 | * allocation lock here as it won't be needed - nobody will |
@@ -947,15 +945,15 @@ void ocfs2_delete_inode(struct inode *inode) | |||
947 | * before we go ahead and wipe the inode. */ | 945 | * before we go ahead and wipe the inode. */ |
948 | status = ocfs2_query_inode_wipe(inode, di_bh, &wipe); | 946 | status = ocfs2_query_inode_wipe(inode, di_bh, &wipe); |
949 | if (!wipe || status < 0) { | 947 | if (!wipe || status < 0) { |
950 | /* Error and inode busy vote both mean we won't be | 948 | /* Error and remote inode busy both mean we won't be |
951 | * removing the inode, so they take almost the same | 949 | * removing the inode, so they take almost the same |
952 | * path. */ | 950 | * path. */ |
953 | if (status < 0) | 951 | if (status < 0) |
954 | mlog_errno(status); | 952 | mlog_errno(status); |
955 | 953 | ||
956 | /* Someone in the cluster has voted to not wipe this | 954 | /* Someone in the cluster has disallowed a wipe of |
957 | * inode, or it was never completely orphaned. Write | 955 | * this inode, or it was never completely |
958 | * out the pages and exit now. */ | 956 | * orphaned. Write out the pages and exit now. */ |
959 | ocfs2_cleanup_delete_inode(inode, 1); | 957 | ocfs2_cleanup_delete_inode(inode, 1); |
960 | goto bail_unlock_inode; | 958 | goto bail_unlock_inode; |
961 | } | 959 | } |
@@ -1008,12 +1006,12 @@ void ocfs2_clear_inode(struct inode *inode) | |||
1008 | mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, | 1006 | mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, |
1009 | "Inode=%lu\n", inode->i_ino); | 1007 | "Inode=%lu\n", inode->i_ino); |
1010 | 1008 | ||
1011 | /* For remove delete_inode vote, we hold open lock before, | 1009 | /* To preven remote deletes we hold open lock before, now it |
1012 | * now it is time to unlock PR and EX open locks. */ | 1010 | * is time to unlock PR and EX open locks. */ |
1013 | ocfs2_open_unlock(inode); | 1011 | ocfs2_open_unlock(inode); |
1014 | 1012 | ||
1015 | /* Do these before all the other work so that we don't bounce | 1013 | /* Do these before all the other work so that we don't bounce |
1016 | * the vote thread while waiting to destroy the locks. */ | 1014 | * the downconvert thread while waiting to destroy the locks. */ |
1017 | ocfs2_mark_lockres_freeing(&oi->ip_rw_lockres); | 1015 | ocfs2_mark_lockres_freeing(&oi->ip_rw_lockres); |
1018 | ocfs2_mark_lockres_freeing(&oi->ip_meta_lockres); | 1016 | ocfs2_mark_lockres_freeing(&oi->ip_meta_lockres); |
1019 | ocfs2_mark_lockres_freeing(&oi->ip_data_lockres); | 1017 | ocfs2_mark_lockres_freeing(&oi->ip_data_lockres); |