diff options
author | Li Dongyang <lidongyang@novell.com> | 2010-04-22 04:11:29 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2010-04-23 14:05:00 -0400 |
commit | 062d340384dcf77dfd8de0a082b5da571de3925a (patch) | |
tree | 875a86d75ff363fbebdb09cff12933bb23525077 /fs/ocfs2 | |
parent | ab41fdc8fdd9f0942430941c1e2b516fd481371d (diff) |
ocfs2: use OCFS2_INODE_SKIP_ORPHAN_DIR in ocfs2_mknod error path
Mark the inode with flag OCFS2_INODE_SKIP_ORPHAN_DIR in ocfs2_mknod, so we
can kill the inode in case of error.
[ Fixed up comment style -Mark ]
Signed-off-by: Li Dongyang <lidongyang@novell.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/namei.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index b66e48855825..8ff035eabfd8 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -445,11 +445,6 @@ leave: | |||
445 | 445 | ||
446 | ocfs2_free_dir_lookup_result(&lookup); | 446 | ocfs2_free_dir_lookup_result(&lookup); |
447 | 447 | ||
448 | if ((status < 0) && inode) { | ||
449 | clear_nlink(inode); | ||
450 | iput(inode); | ||
451 | } | ||
452 | |||
453 | if (inode_ac) | 448 | if (inode_ac) |
454 | ocfs2_free_alloc_context(inode_ac); | 449 | ocfs2_free_alloc_context(inode_ac); |
455 | 450 | ||
@@ -459,6 +454,17 @@ leave: | |||
459 | if (meta_ac) | 454 | if (meta_ac) |
460 | ocfs2_free_alloc_context(meta_ac); | 455 | ocfs2_free_alloc_context(meta_ac); |
461 | 456 | ||
457 | /* | ||
458 | * We should call iput after the i_mutex of the bitmap been | ||
459 | * unlocked in ocfs2_free_alloc_context, or the | ||
460 | * ocfs2_delete_inode will mutex_lock again. | ||
461 | */ | ||
462 | if ((status < 0) && inode) { | ||
463 | OCFS2_I(inode)->ip_flags |= OCFS2_INODE_SKIP_ORPHAN_DIR; | ||
464 | clear_nlink(inode); | ||
465 | iput(inode); | ||
466 | } | ||
467 | |||
462 | mlog_exit(status); | 468 | mlog_exit(status); |
463 | 469 | ||
464 | return status; | 470 | return status; |