aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2013-10-29 02:17:05 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-10-29 02:56:08 -0400
commitcc3de6a3acce264f4eb0b5bf552478e5f1380bba (patch)
tree99923af99c4fa2a89ca2affa9786e1f72915601e /fs/f2fs
parent5d56b6718a0f4e5c58cdd3cb6b7a472d7c5671b9 (diff)
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 <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/xattr.c2
1 files changed, 1 insertions, 1 deletions
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,
520 */ 520 */
521 free = MIN_OFFSET(inode) - ((char *)last - (char *)base_addr); 521 free = MIN_OFFSET(inode) - ((char *)last - (char *)base_addr);
522 if (found) 522 if (found)
523 free = free - ENTRY_SIZE(here); 523 free = free + ENTRY_SIZE(here);
524 524
525 if (free < newsize) { 525 if (free < newsize) {
526 error = -ENOSPC; 526 error = -ENOSPC;