f2fs: drop calling alloc_nid_failed when no nid is allocated
PATCH 3/3 f2fs: drop calling alloc_nid_failed when no nid is allocated
If hsize is less than or equal to inlien_size, and i_xattr_nid is valid, the new_nid is not allocated (no alloc_nid is called).
if (hsize > inline_size && !F2FS_I(inode)->i_xattr_nid)
if (!alloc_nid(sbi, &new_nid))
return -ENOSPC;Although it's harmless calling alloc_nid_failed, it's better drop them.
--- fs/f2fs/xattr.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
fs/f2fs/xattr.c +4 -5
@@ -428,19 +428,18 @@ static inline int write_all_xattrs(struct inode *inode, __u32 hsize,/* no need to use xattr node block */ if (hsize <= inline_size) { err =truncate_xattr_node (inode, ipage); -alloc_nid_failed (sbi, new_nid); +f2fs_bug_on (sbi, new_nid);return err; } }/* write to xattr node block */ if (F2FS_I (inode)->i_xattr_nid) { +f2fs_bug_on (sbi, new_nid); xpage =get_node_page (sbi,F2FS_I (inode)->i_xattr_nid); -if (IS_ERR (xpage)) { -alloc_nid_failed (sbi, new_nid); +if (IS_ERR (xpage))return PTR_ERR (xpage); - } -f2fs_bug_on (sbi, new_nid); +f2fs_wait_on_page_writeback (xpage,NODE , true); }else {struct dnode_of_data dn;
Signature · 6 lines
2.9.3 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Quoted 19 lines · Kinglong Mee
If hsize is less than or equal to
inlien_size, andi_xattr_nidis valid, thenew_nidis not allocated (noalloc_nidis called).if (hsize > inline_size && !F2FS_I(inode)->i_xattr_nid) if (!alloc_nid(sbi, &new_nid)) return -ENOSPC;Although it's harmless calling
alloc_nid_failed, it's better drop them.Signed-off-by Kinglong Mee <[email protected]>--- fs/f2fs/xattr.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)fs/f2fs/xattr.c +0
-0
fs/f2fs/xattr.c static inline int write_all_xattrs(struct inode *inode, __u32 hsize, · line 431
Quoted 4 lines
fs/f2fs/xattr.c +0
-1@@ -428,19 +428,18 @@ static inline int write_all_xattrs(struct inode *inode, __u32 hsize,/* no need to use xattr node block */ if (hsize <= inline_size) { err =truncate_xattr_node (inode, ipage); -alloc_nid_failed (sbi, new_nid);
Should keep this since new_nid was assigned above?
Quoted 5 lines
fs/f2fs/xattr.c +1
-0+f2fs_bug_on (sbi, new_nid);return err; } }
fs/f2fs/xattr.c static inline int write_all_xattrs(struct inode *inode, __u32 hsize, · line 443
Quoted 10 lines
fs/f2fs/xattr.c +2
-4/* write to xattr node block */ if (F2FS_I (inode)->i_xattr_nid) { +f2fs_bug_on (sbi, new_nid); xpage =get_node_page (sbi,F2FS_I (inode)->i_xattr_nid); -if (IS_ERR (xpage)) { -alloc_nid_failed (sbi, new_nid); +if (IS_ERR (xpage))return PTR_ERR (xpage); - } -f2fs_bug_on (sbi, new_nid);
Cleanup here looks good to me.
Thanks,
fs/f2fs/xattr.c static inline int write_all_xattrs(struct inode *inode, __u32 hsize, · line 445
Quoted 5 lines
fs/f2fs/xattr.c +1
-0+f2fs_wait_on_page_writeback (xpage,NODE , true); }else {struct dnode_of_data dn;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Quoted 15 lines · Chao Yu
Quoted 14 lines · Kinglong Mee
If hsize is less than or equal to
inlien_size, andi_xattr_nidis valid, thenew_nidis not allocated (noalloc_nidis called).if (hsize > inline_size && !F2FS_I(inode)->i_xattr_nid) if (!alloc_nid(sbi, &new_nid)) return -ENOSPC;Although it's harmless calling
alloc_nid_failed, it's better drop them.Signed-off-by Kinglong Mee <[email protected]>--- fs/f2fs/xattr.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
Quoted 11 lines
fs/f2fs/xattr.c static inline int write_all_xattrs(struct inode *inode, __u32 hsize, · line 431
Quoted 9 lines
fs/f2fs/xattr.c +0
-1@@ -428,19 +428,18 @@ static inline int write_all_xattrs(struct inode *inode, __u32 hsize,/* no need to use xattr node block */ if (hsize <= inline_size) { err =truncate_xattr_node (inode, ipage); -alloc_nid_failed (sbi, new_nid);Should keep this since
new_nidwas assigned above?
alloc_nid is called when,
403 if (hsize > inline_size && !F2FS_I(inode)->i_xattr_nid)
404 if (!alloc_nid(sbi, &new_nid))
405 return -ENOSPC;
if (hsize <= inline_size), alloc_nid isn't called.
thanks,
Kinglong Mee
Quoted 19 lines
Quoted 6 lines
fs/f2fs/xattr.c +1
-0+f2fs_bug_on (sbi, new_nid);return err; } }fs/f2fs/xattr.c static inline int write_all_xattrs(struct inode *inode, __u32 hsize, · line 443
Quoted 10 lines
fs/f2fs/xattr.c +2
-4/* write to xattr node block */ if (F2FS_I (inode)->i_xattr_nid) { +f2fs_bug_on (sbi, new_nid); xpage =get_node_page (sbi,F2FS_I (inode)->i_xattr_nid); -if (IS_ERR (xpage)) { -alloc_nid_failed (sbi, new_nid); +if (IS_ERR (xpage))return PTR_ERR (xpage); - } -f2fs_bug_on (sbi, new_nid);Cleanup here looks good to me.
Quoted 9 lines
Thanks,
Quoted 5 lines
fs/f2fs/xattr.c +1
-0+f2fs_wait_on_page_writeback (xpage,NODE , true); }else {struct dnode_of_data dn;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Quoted 28 lines · Kinglong Mee
Quoted 15 lines · Chao Yu
Quoted 14 lines · Kinglong Mee
If hsize is less than or equal to
inlien_size, andi_xattr_nidis valid, thenew_nidis not allocated (noalloc_nidis called).if (hsize > inline_size && !F2FS_I(inode)->i_xattr_nid) if (!alloc_nid(sbi, &new_nid)) return -ENOSPC;Although it's harmless calling
alloc_nid_failed, it's better drop them.Signed-off-by Kinglong Mee <[email protected]>--- fs/f2fs/xattr.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)Quoted 11 lines
fs/f2fs/xattr.c static inline int write_all_xattrs(struct inode *inode, __u32 hsize, · line 431
Quoted 9 lines
fs/f2fs/xattr.c +0
-1@@ -428,19 +428,18 @@ static inline int write_all_xattrs(struct inode *inode, __u32 hsize,/* no need to use xattr node block */ if (hsize <= inline_size) { err =truncate_xattr_node (inode, ipage); -alloc_nid_failed (sbi, new_nid);Should keep this since
new_nidwas assigned above?
Quoted 8 lines
alloc_nidis called when,403 if (hsize >
inline_size&& !F2FS_I(inode)->i_xattr_nid)
404 if (!alloc_nid(sbi,&new_nid))
405 return-ENOSPC;if (hsize <=
inline_size),alloc_nidisn't called.
You're right, I can confirm that. :)
Thanks,
Quoted 32 lines
thanks,
Kinglong MeeQuoted 19 lines
Quoted 6 lines
fs/f2fs/xattr.c +1
-0+f2fs_bug_on (sbi, new_nid);return err; } }fs/f2fs/xattr.c static inline int write_all_xattrs(struct inode *inode, __u32 hsize, · line 443
Quoted 10 lines
fs/f2fs/xattr.c +2
-4/* write to xattr node block */ if (F2FS_I (inode)->i_xattr_nid) { +f2fs_bug_on (sbi, new_nid); xpage =get_node_page (sbi,F2FS_I (inode)->i_xattr_nid); -if (IS_ERR (xpage)) { -alloc_nid_failed (sbi, new_nid); +if (IS_ERR (xpage))return PTR_ERR (xpage); - } -f2fs_bug_on (sbi, new_nid);Cleanup here looks good to me.
Quoted 9 lines
Thanks,
Quoted 5 lines
fs/f2fs/xattr.c +1
-0+f2fs_wait_on_page_writeback (xpage,NODE , true); }else {struct dnode_of_data dn;
Quoted 2 lines
.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot