[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-mm-commits
Subject:    + ocfs2-access-orphan-dinode-before-delete-entry-in-ocfs2_orphan_del.patch
From:       akpm () linux-foundation ! org
Date:       2015-12-29 21:42:24
Message-ID: 5682fe40.HDCEs9+1drsV+88R%akpm () linux-foundation ! org
[Download RAW message or body]


The patch titled
     Subject: ocfs2: access orphan dinode before delete entry in ocfs2_orphan_del
has been added to the -mm tree.  Its filename is
     ocfs2-access-orphan-dinode-before-delete-entry-in-ocfs2_orphan_del.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-access-orphan-dinode-before-delete-entry-in-ocfs2_orphan_del.patch
 and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-access-orphan-dinode-before-delete-entry-in-ocfs2_orphan_del.patch


Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Joseph Qi <joseph.qi@huawei.com>
Subject: ocfs2: access orphan dinode before delete entry in ocfs2_orphan_del

In ocfs2_orphan_del, currently it finds and deletes entry first, and then
access orphan dir dinode.  This will have a problem once
ocfs2_journal_access_di fails.  In this case, entry will be removed from
orphan dir, but in deed the inode hasn't been deleted successfully.  In
other words, the file is missing but not actually deleted.  So we should
access orphan dinode first like unlink and rename.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Jiufei Xue <xuejiufei@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/ocfs2/namei.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff -puN fs/ocfs2/namei.c~ocfs2-access-orphan-dinode-before-delete-entry-in-ocfs2_orphan_del \
                fs/ocfs2/namei.c
--- a/fs/ocfs2/namei.c~ocfs2-access-orphan-dinode-before-delete-entry-in-ocfs2_orphan_del
                
+++ a/fs/ocfs2/namei.c
@@ -2371,6 +2371,15 @@ int ocfs2_orphan_del(struct ocfs2_super
 	     (unsigned long long)OCFS2_I(orphan_dir_inode)->ip_blkno,
 	     name, strlen(name));
 
+	status = ocfs2_journal_access_di(handle,
+					 INODE_CACHE(orphan_dir_inode),
+					 orphan_dir_bh,
+					 OCFS2_JOURNAL_ACCESS_WRITE);
+	if (status < 0) {
+		mlog_errno(status);
+		goto leave;
+	}
+
 	/* find it's spot in the orphan directory */
 	status = ocfs2_find_entry(name, strlen(name), orphan_dir_inode,
 				  &lookup);
@@ -2384,15 +2393,6 @@ int ocfs2_orphan_del(struct ocfs2_super
 	if (status < 0) {
 		mlog_errno(status);
 		goto leave;
-	}
-
-	status = ocfs2_journal_access_di(handle,
-					 INODE_CACHE(orphan_dir_inode),
-					 orphan_dir_bh,
-					 OCFS2_JOURNAL_ACCESS_WRITE);
-	if (status < 0) {
-		mlog_errno(status);
-		goto leave;
 	}
 
 	/* do the i_nlink dance! :) */
_

Patches currently in -mm which might be from joseph.qi@huawei.com are

ocfs2-fix-bug-when-calculate-new-backup-super.patch
ocfs2-clean-up-redundant-null-check-before-iput.patch
ocfs2-access-orphan-dinode-before-delete-entry-in-ocfs2_orphan_del.patch
ocfs2-dlm-fix-race-between-convert-and-recovery.patch
ocfs2-dlm-fix-race-between-convert-and-recovery-v2.patch
ocfs2-dlm-fix-race-between-convert-and-recovery-v3.patch
ocfs2-dlm-fix-bug-in-dlm_move_lockres_to_recovery_list.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic