From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F0AF168CF for ; Mon, 8 May 2023 11:11:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBBD8C4339E; Mon, 8 May 2023 11:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683544319; bh=lNjmbCvH+CZQQA67V5iYciN8E/xbTUjyPb77CBJzdZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TdPxzE1to2pgdtuRjAnaSp/nP86IED445SVznCeHBaFxV1QVW5L9LH7JS2Eznk8p8 S1REz67z7j7lDi+iCrL09f2h9sDn9lBWMFOgWrU8qRzAiHOXB7QPMoDr9xrjgQHwXA bIO42nJO7jWgjefv0hq56/Wqnj9SnkA52TWaKg18= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yangtao Li , Jaegeuk Kim , Sasha Levin Subject: [PATCH 6.3 371/694] f2fs: handle dqget error in f2fs_transfer_project_quota() Date: Mon, 8 May 2023 11:43:26 +0200 Message-Id: <20230508094444.849707340@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230508094432.603705160@linuxfoundation.org> References: <20230508094432.603705160@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Yangtao Li [ Upstream commit 8051692f5f23260215bfe9a72e712d93606acc5f ] We should set the error code when dqget() failed. Fixes: 2c1d03056991 ("f2fs: support F2FS_IOC_FS{GET,SET}XATTR") Signed-off-by: Yangtao Li Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/file.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 15dabeac46905..4f684b99ba5a3 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3009,15 +3009,16 @@ int f2fs_transfer_project_quota(struct inode *inode, kprojid_t kprojid) struct dquot *transfer_to[MAXQUOTAS] = {}; struct f2fs_sb_info *sbi = F2FS_I_SB(inode); struct super_block *sb = sbi->sb; - int err = 0; + int err; transfer_to[PRJQUOTA] = dqget(sb, make_kqid_projid(kprojid)); - if (!IS_ERR(transfer_to[PRJQUOTA])) { - err = __dquot_transfer(inode, transfer_to); - if (err) - set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR); - dqput(transfer_to[PRJQUOTA]); - } + if (IS_ERR(transfer_to[PRJQUOTA])) + return PTR_ERR(transfer_to[PRJQUOTA]); + + err = __dquot_transfer(inode, transfer_to); + if (err) + set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR); + dqput(transfer_to[PRJQUOTA]); return err; } -- 2.39.2