fs/f2fs/file.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
We should set the error code when dqget() failed.
Fixes: 2c1d03056991 ("f2fs: support F2FS_IOC_FS{GET,SET}XATTR")
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
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 ca1720fc1187..f25e58680984 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.25.1
+Shilong, Hi, Shilong, Could you please help to check this patch? in original patch, it tries to ignore such error intentionally? or it is a bug? On 2023/2/21 22:45, Yangtao Li wrote: > We should set the error code when dqget() failed. > > Fixes: 2c1d03056991 ("f2fs: support F2FS_IOC_FS{GET,SET}XATTR") > Signed-off-by: Yangtao Li <frank.li@vivo.com> > --- > 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 ca1720fc1187..f25e58680984 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; > } >
Hello: This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <jaegeuk@kernel.org>: On Tue, 21 Feb 2023 22:45:50 +0800 you wrote: > We should set the error code when dqget() failed. > > Fixes: 2c1d03056991 ("f2fs: support F2FS_IOC_FS{GET,SET}XATTR") > Signed-off-by: Yangtao Li <frank.li@vivo.com> > --- > fs/f2fs/file.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) Here is the summary with links: - [f2fs-dev] f2fs: handle dqget error in f2fs_transfer_project_quota() https://git.kernel.org/jaegeuk/f2fs/c/03ae2bf52a75 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
© 2016 - 2025 Red Hat, Inc.