linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: fix calculating incorrect free size when update xattr in __f2fs_setxattr
@ 2013-10-29  6:17 Chao Yu
  0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2013-10-29  6:17 UTC (permalink / raw)
  To: ???
  Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel,
	'谭姝'

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>
---
 fs/f2fs/xattr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index f685138..35eb478 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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-10-29  6:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-29  6:17 [f2fs-dev] [PATCH] f2fs: fix calculating incorrect free size when update xattr in __f2fs_setxattr Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).