aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2014-04-03 17:46:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:20:54 -0400
commitbd62ad7aebd8e8895bb7649ace948040332f27d3 (patch)
tree76804b6ebfb371816066ad074b7f2af371740563 /fs
parent7bf619c1425d5f03e33c744921f6251f4d0d745f (diff)
ocfs2: move dquot_initialize() in ocfs2_delete_inode() somewhat later
Move dquot_initalize() call in ocfs2_delete_inode() after the moment we verify inode is actually a sane one to delete. We certainly don't want to initialize quota for system inodes etc. This also avoids calling into quota code from downconvert thread. Add more details into the comment why bailing out from ocfs2_delete_inode() when we are in downconvert thread is OK. Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: Mark Fasheh <mfasheh@suse.de> Reviewed-by: Srinivas Eeda <srinivas.eeda@oracle.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/inode.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 2f7d75d59f04..809b5d57a6b8 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -831,11 +831,13 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode)
831 goto bail; 831 goto bail;
832 } 832 }
833 833
834 /* If we're coming from downconvert_thread we can't go into our own 834 /*
835 * voting [hello, deadlock city!], so unforuntately we just 835 * If we're coming from downconvert_thread we can't go into our own
836 * have to skip deleting this guy. That's OK though because 836 * voting [hello, deadlock city!] so we cannot delete the inode. But
837 * the node who's doing the actual deleting should handle it 837 * since we dropped last inode ref when downconverting dentry lock,
838 * anyway. */ 838 * we cannot have the file open and thus the node doing unlink will
839 * take care of deleting the inode.
840 */
839 if (current == osb->dc_task) 841 if (current == osb->dc_task)
840 goto bail; 842 goto bail;
841 843
@@ -981,8 +983,6 @@ static void ocfs2_delete_inode(struct inode *inode)
981 if (is_bad_inode(inode) || !OCFS2_I(inode)->ip_blkno) 983 if (is_bad_inode(inode) || !OCFS2_I(inode)->ip_blkno)
982 goto bail; 984 goto bail;
983 985
984 dquot_initialize(inode);
985
986 if (!ocfs2_inode_is_valid_to_delete(inode)) { 986 if (!ocfs2_inode_is_valid_to_delete(inode)) {
987 /* It's probably not necessary to truncate_inode_pages 987 /* It's probably not necessary to truncate_inode_pages
988 * here but we do it for safety anyway (it will most 988 * here but we do it for safety anyway (it will most
@@ -991,6 +991,8 @@ static void ocfs2_delete_inode(struct inode *inode)
991 goto bail; 991 goto bail;
992 } 992 }
993 993
994 dquot_initialize(inode);
995
994 /* We want to block signals in delete_inode as the lock and 996 /* We want to block signals in delete_inode as the lock and
995 * messaging paths may return us -ERESTARTSYS. Which would 997 * messaging paths may return us -ERESTARTSYS. Which would
996 * cause us to exit early, resulting in inodes being orphaned 998 * cause us to exit early, resulting in inodes being orphaned