Skip to contentSkip to conversation

ocfs2: remove extra mlog_errno() call in __ocfs2_add_entry()

PATCH RESEND In review Daeseok Youn 2 participants 3 messages Feb 27, 2015 – Mar 20, 2015 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 2/4 ocfs2: remove extra mlog_errno() call in __ocfs2_add_entry()

---
RESEND: this patch is rebased by 1/4

 fs/ocfs2/dir.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
fs/ocfs2/dir.c +2 -6
index 1478a50..c1ab24f 100644
@@ -1689,10 +1689,8 @@ int __ocfs2_add_entry(handle_t *handle,
 		if (ocfs2_dirent_would_fit(de, rec_len)) {
 			dir->i_mtime = dir->i_ctime = CURRENT_TIME;
 			retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh);
-			if (retval < 0) {
-				mlog_errno(retval);
+			if (retval < 0)
 				goto bail;
-			}
 
 			if (insert_bh == parent_fe_bh)
 				retval = ocfs2_journal_access_di(handle,
@@ -1709,10 +1707,8 @@ int __ocfs2_add_entry(handle_t *handle,
 					retval = ocfs2_dx_dir_insert(dir,
 								handle,
 								lookup);
-					if (retval) {
-						mlog_errno(retval);
+					if (retval)
 						goto bail;
-					}
 				}
 			}
 
Signature · 1 line
1.7.1
#1 lore raw
Quoted 26 lines · Daeseok Youn

---
RESEND: this patch is rebased by 1/4

 fs/ocfs2/dir.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
fs/ocfs2/dir.c +1 -3
index 1478a50..c1ab24f 100644
@@ -1689,10 +1689,8 @@ int __ocfs2_add_entry(handle_t *handle,
 		if (ocfs2_dirent_would_fit(de, rec_len)) {
 			dir->i_mtime = dir->i_ctime = CURRENT_TIME;
 			retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh);
-			if (retval < 0) {
-				mlog_errno(retval);
+			if (retval < 0)
 				goto bail;
-			}
 
 			if (insert_bh == parent_fe_bh)
 				retval = ocfs2_journal_access_di(handle,
@@ -1709,10 +1707,8 @@ int __ocfs2_add_entry(handle_t *handle,
 					retval = ocfs2_dx_dir_insert(dir,

fs/ocfs2/dir.c int __ocfs2_add_entry(handle_t *handle, · line 1714

Quoted 10 lines
fs/ocfs2/dir.c +1 -3
 								handle,
 								lookup);
-					if (retval) {
-						mlog_errno(retval);
+					if (retval)
 						goto bail;
-					}
 				}
 			}
 

IMO, these two mlogs are not "extra" because we can directly know the cause if error occurs.

#2 lore raw

OK.

If i want to clean up mlog() call twice, mlog() in " bail" can be removed, right?

Thanks.
Regards,
Daeseok Youn

2015-03-19 19:45 GMT+09:00 Joseph Qi <[email protected]>:

Quoted 40 lines · Daeseok Youn
Quoted 26 lines

---
RESEND: this patch is rebased by 1/4

 fs/ocfs2/dir.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
fs/ocfs2/dir.c +1 -3
index 1478a50..c1ab24f 100644
@@ -1689,10 +1689,8 @@ int __ocfs2_add_entry(handle_t *handle,
              if (ocfs2_dirent_would_fit(de, rec_len)) {
                      dir->i_mtime = dir->i_ctime = CURRENT_TIME;
                      retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh);
-                     if (retval < 0) {
-                             mlog_errno(retval);
+                     if (retval < 0)
                              goto bail;
-                     }
 
                      if (insert_bh == parent_fe_bh)
                              retval = ocfs2_journal_access_di(handle,
@@ -1709,10 +1707,8 @@ int __ocfs2_add_entry(handle_t *handle,
                                      retval = ocfs2_dx_dir_insert(dir,

fs/ocfs2/dir.c int __ocfs2_add_entry(handle_t *handle, · line 1714

Quoted 10 lines
fs/ocfs2/dir.c +1 -3
                                                              handle,
                                                              lookup);
-                                     if (retval) {
-                                             mlog_errno(retval);
+                                     if (retval)
                                              goto bail;
-                                     }
                              }
                      }
 

IMO, these two mlogs are not "extra" because we can directly know the cause if error occurs.