[PATCH RESEND] f2fs: make f2fs_read_inline_data() more readable

Chao Liu posted 1 patch 3 years, 11 months ago
fs/f2fs/f2fs.h | 4 ++++
1 file changed, 4 insertions(+)
[PATCH RESEND] f2fs: make f2fs_read_inline_data() more readable
Posted by Chao Liu 3 years, 11 months ago
From: Chao Liu <liuchao@coolpad.com>

In f2fs_read_inline_data(), it is confused with checking of
inline_data flag, as we checked it before calling. So this
patch add some comments for f2fs_has_inline_data().

Signed-off-by: Chao Liu <liuchao@coolpad.com>
---
 fs/f2fs/f2fs.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index f579e2ed0f14..5071f6636e41 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -3167,6 +3167,10 @@ static inline int inline_xattr_size(struct inode *inode)
 	return 0;
 }
 
+/*
+ * Notice: check inline_data flag without inode page lock is unsafe.
+ * It could change at any time by f2fs_convert_inline_page().
+ */
 static inline int f2fs_has_inline_data(struct inode *inode)
 {
 	return is_inode_flag_set(inode, FI_INLINE_DATA);
-- 
2.36.1
Re: [PATCH RESEND] f2fs: make f2fs_read_inline_data() more readable
Posted by Chao Yu 3 years, 11 months ago
On 2022/5/19 18:40, Chao Liu wrote:
> From: Chao Liu <liuchao@coolpad.com>
> 
> In f2fs_read_inline_data(), it is confused with checking of
> inline_data flag, as we checked it before calling. So this
> patch add some comments for f2fs_has_inline_data().
> 
> Signed-off-by: Chao Liu <liuchao@coolpad.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,