ocfs2: should call ocfs2_journal_access_di() before ocfs2_delete_entry() in ocfs2_orphan_del()
PATCH 1/1 ocfs2: should call ocfs2_journal_access_di() before ocfs2_delete_entry() in ocfs2_orphan_del()
While deleting a file into orphan dir in ocfs2_orphan_del(), it calls ocfs2_delete_entry() before ocfs2_journal_access_di(). If ocfs2_delete_entry() succeeded and ocfs2_journal_access_di() failed, there would be a inconsistency: the file is deleted from orphan dir, but orphan dir dinode is not updated.
So, need to call ocfs2_journal_access_di() before ocfs2_orphan_del().
--- fs/ocfs2/namei.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
fs/ocfs2/namei.c +6 -6
@@ -2102,17 +2102,17 @@ int ocfs2_orphan_del(struct ocfs2_super *osb, goto leave; } -/* remove it from the orphan directory */ - status =ocfs2_delete_entry (handle, orphan_dir_inode, &lookup); + 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; } - status =ocfs2_journal_access_di (handle, -INODE_CACHE (orphan_dir_inode), - orphan_dir_bh, -OCFS2_JOURNAL_ACCESS_WRITE ); +/* remove it from the orphan directory */ + status =ocfs2_delete_entry (handle, orphan_dir_inode, &lookup);if (status <0 ) {mlog_errno (status); goto leave;
Signature · 1 line
1.7.9.7
PATCH 1/1 ocfs2: should call ocfs2_journal_access_di() before ocfs2_delete_entry() in ocfs2_orphan_del()
Folks, 3.10 is nigh. Could we please have some review and test of this patch?
From: Younger Liu <[email protected]>
Subject: ocfs2: should call ocfs2_journal_access_di() before ocfs2_delete_entry() in ocfs2_orphan_del()
While deleting a file into orphan dir in ocfs2_orphan_del(), it calls ocfs2_delete_entry() before ocfs2_journal_access_di(). If ocfs2_delete_entry() succeeded and ocfs2_journal_access_di() failed, there would be a inconsistency: the file is deleted from orphan dir, but orphan dir dinode is not updated.
So we need to call ocfs2_journal_access_di() before ocfs2_orphan_del().
---
fs/ocfs2/namei.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
fs/ocfs2/namei.c renamed from fs/ocfs2/namei.c~ocfs2-should-call-ocfs2_journal_access_di-before-ocfs2_delete_entry-in-ocfs2_orphan_del +6 -6
@@ -2095,17 +2095,17 @@ int ocfs2_orphan_del(struct ocfs2_super goto leave; } -/* remove it from the orphan directory */ - status =ocfs2_delete_entry (handle, orphan_dir_inode, &lookup); + 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; } - status =ocfs2_journal_access_di (handle, -INODE_CACHE (orphan_dir_inode), - orphan_dir_bh, -OCFS2_JOURNAL_ACCESS_WRITE ); +/* remove it from the orphan directory */ + status =ocfs2_delete_entry (handle, orphan_dir_inode, &lookup);if (status <0 ) {mlog_errno (status); goto leave;
_
PATCH 1/1 ocfs2: should call ocfs2_journal_access_di() before ocfs2_delete_entry() in ocfs2_orphan_del()
NAK. Current code looks ok.
Quoted 61 lines · Andrew Morton
Folks, 3.10 is nigh. Could we please have some review and test of this patch?
From: Younger Liu <[email protected]>
Subject: ocfs2: should callocfs2_journal_access_di()beforeocfs2_delete_entry()inocfs2_orphan_del()While deleting a file into orphan dir in
ocfs2_orphan_del(), it callsocfs2_delete_entry()beforeocfs2_journal_access_di(). Ifocfs2_delete_entry()succeeded andocfs2_journal_access_di()failed, there would be a inconsistency: the file is deleted from orphan dir, but orphan dir dinode is not updated.So we need to call
ocfs2_journal_access_di()beforeocfs2_orphan_del().Signed-off-by Younger Liu <[email protected]>Cc Jie Liu <[email protected]>Cc Joel Becker <[email protected]>Cc Mark Fasheh <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
fs/ocfs2/namei.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)diff -puN
fs/ocfs2/namei.c~ocfs2-should-call-ocfs2_journal_access_di-before-ocfs2_delete_entry-in-ocfs2_orphan_delfs/ocfs2/namei.c
---
a/fs/ocfs2/namei.c~ocfs2-should-call-ocfs2_journal_access_di-before-ocfs2_delete_entry-in-ocfs2_orphan_del +++a/fs/ocfs2/namei.cfs/ocfs2/namei.c renamed from fs/ocfs2/namei.c~ocfs2-should-call-ocfs2_journal_access_di-before-ocfs2_delete_entry-in-ocfs2_orphan_del +6
-6@@ -2095,17 +2095,17 @@ int ocfs2_orphan_del(struct ocfs2_super goto leave; } -/* remove it from the orphan directory */ - status =ocfs2_delete_entry (handle, orphan_dir_inode, &lookup); + 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; } - status =ocfs2_journal_access_di (handle, -INODE_CACHE (orphan_dir_inode), - orphan_dir_bh, -OCFS2_JOURNAL_ACCESS_WRITE ); +/* remove it from the orphan directory */ + status =ocfs2_delete_entry (handle, orphan_dir_inode, &lookup);if (status <0 ) {mlog_errno (status); goto leave;_
Quoted 5 lines
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20130628/4c0a2f05/attachment-0001.html
PATCH 1/1 ocfs2: should call ocfs2_journal_access_di() before ocfs2_delete_entry() in ocfs2_orphan_del()
In reply to Andrew MortonQuoted 63 lines · Andrew Morton
Folks, 3.10 is nigh. Could we please have some review and test of this patch?
From: Younger Liu <[email protected]>
Subject: ocfs2: should callocfs2_journal_access_di()beforeocfs2_delete_entry()inocfs2_orphan_del()While deleting a file into orphan dir in
ocfs2_orphan_del(), it callsocfs2_delete_entry()beforeocfs2_journal_access_di(). Ifocfs2_delete_entry()succeeded andocfs2_journal_access_di()failed, there would be a inconsistency: the file is deleted from orphan dir, but orphan dir dinode is not updated.So we need to call
ocfs2_journal_access_di()beforeocfs2_orphan_del().Signed-off-by Younger Liu <[email protected]>Cc Jie Liu <[email protected]>Cc Joel Becker <[email protected]>Cc Mark Fasheh <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
fs/ocfs2/namei.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)diff -puN
fs/ocfs2/namei.c~ocfs2-should-call-ocfs2_journal_access_di-before-ocfs2_delete_entry-in-ocfs2_orphan_delfs/ocfs2/namei.cfs/ocfs2/namei.c renamed from fs/ocfs2/namei.c~ocfs2-should-call-ocfs2_journal_access_di-before-ocfs2_delete_entry-in-ocfs2_orphan_del +6
-6@@ -2095,17 +2095,17 @@ int ocfs2_orphan_del(struct ocfs2_super goto leave; } -/* remove it from the orphan directory */ - status =ocfs2_delete_entry (handle, orphan_dir_inode, &lookup); + 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; } - status =ocfs2_journal_access_di (handle, -INODE_CACHE (orphan_dir_inode), - orphan_dir_bh, -OCFS2_JOURNAL_ACCESS_WRITE ); +/* remove it from the orphan directory */ + status =ocfs2_delete_entry (handle, orphan_dir_inode, &lookup);if (status <0 ) {mlog_errno (status); goto leave;_
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel