lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-Id: <1373328699-23037-1-git-send-email-wenqing.lz@taobao.com> Date: Tue, 9 Jul 2013 08:11:39 +0800 From: Zheng Liu <gnehzuil.liu@...il.com> To: linux-ext4@...r.kernel.org Cc: Zheng Liu <wenqing.lz@...bao.com>, Tao Ma <tm@....ma>, "Theodore Ts'o" <tytso@....edu> Subject: [PATCH] ext4: make ext4_add_dirent_to_inline function return 0 From: Zheng Liu <wenqing.lz@...bao.com> Currently ext4_add_dirent_to_inline() function returns 1 to indicate that a new directory entry has been added. But it sounds reasonable to return 0 in this function. Meanwhile we also can eliminate a if statement in ext4_add_entry() function when a directory entry has added correctly. Signed-off-by: Zheng Liu <wenqing.lz@...bao.com> Cc: Tao Ma <tm@....ma> Cc: "Theodore Ts'o" <tytso@....edu> --- fs/ext4/inline.c | 2 +- fs/ext4/namei.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index b8a0746..5a27d32 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1027,7 +1027,7 @@ static int ext4_add_dirent_to_inline(handle_t *handle, ext4_update_dx_flag(dir); dir->i_version++; ext4_mark_inode_dirty(handle, dir); - return 1; + return 0; } static void *ext4_get_inline_xattr_pos(struct inode *inode, diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index ab2f6dc..2a6a736 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1901,12 +1901,8 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry, if (ext4_has_inline_data(dir)) { retval = ext4_try_add_inline_entry(handle, dentry, inode); - if (retval < 0) + if (retval <= 0) return retval; - if (retval == 1) { - retval = 0; - return retval; - } } if (is_dx(dir)) { -- 1.7.9.7 -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists