Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6eda3dd3 authored by Tiger Yang's avatar Tiger Yang Committed by Joel Becker
Browse files

ocfs2: do not overwrite error codes in ocfs2_init_acl



Setting the acl while creating a new inode depends on
the error codes of posix_acl_create_masq. This patch fix
a issue of overwriting the error codes of it.

Reported-by: default avatarPawel Zawora <pzawora@gmail.com>
Cc: <stable@kernel.org> [ .33, .34 ]
Signed-off-by: default avatarTiger Yang <tiger.yang@oracle.com>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent 9fe6206f
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -344,7 +344,7 @@ int ocfs2_init_acl(handle_t *handle,
{
{
	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
	struct posix_acl *acl = NULL;
	struct posix_acl *acl = NULL;
	int ret = 0;
	int ret = 0, ret2;
	mode_t mode;
	mode_t mode;


	if (!S_ISLNK(inode->i_mode)) {
	if (!S_ISLNK(inode->i_mode)) {
@@ -381,7 +381,12 @@ int ocfs2_init_acl(handle_t *handle,
		mode = inode->i_mode;
		mode = inode->i_mode;
		ret = posix_acl_create_masq(clone, &mode);
		ret = posix_acl_create_masq(clone, &mode);
		if (ret >= 0) {
		if (ret >= 0) {
			ret = ocfs2_acl_set_mode(inode, di_bh, handle, mode);
			ret2 = ocfs2_acl_set_mode(inode, di_bh, handle, mode);
			if (ret2) {
				mlog_errno(ret2);
				ret = ret2;
				goto cleanup;
			}
			if (ret > 0) {
			if (ret > 0) {
				ret = ocfs2_set_acl(handle, inode,
				ret = ocfs2_set_acl(handle, inode,
						    di_bh, ACL_TYPE_ACCESS,
						    di_bh, ACL_TYPE_ACCESS,