Skip to contentSkip to conversation

f2fs: fix calculating incorrect free size when update xattr in __f2fs_setxattr

PATCH New Chao Yu 1 participant 1 message Oct 29, 2013

Subsystems (2)
lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 f2fs: fix calculating incorrect free size when update xattr in __f2fs_setxattr

During xattr updating, free size should be corrected to remainder free size
+ old entry size.
It can avoid ENOSPC error when we update old entry with the same size new entry at fully filled xattr.

---
 fs/f2fs/xattr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/xattr.c +0 -0
index f685138..35eb478 100644
@@ -520,7 +520,7 @@ static int __f2fs_setxattr(struct inode *inode, int

name_index,
*/
free = MIN_OFFSET(inode) - ((char *)last - (char
*)base_addr);
if (found)
- free = free - ENTRY_SIZE(here);
+ free = free + ENTRY_SIZE(here);

if (free < newsize) {
error = -ENOSPC;

Signature · 1 line
1.7.9.5