From: Chao Yu Date: Tue, 29 Oct 2013 06:17:05 +0000 (+0800) Subject: f2fs: fix calculating incorrect free size when update xattr in __f2fs_setxattr X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=cc3de6a3acce264f4eb0b5bf552478e5f1380bba;p=openwrt%2Fstaging%2Fblogic.git 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. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 89d506d0b35d..aa7a3f139fe5 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -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;