Skip to contentSkip to conversation

f2fs: convert inline_data for f2fs_fiemap

PATCH In review Jaegeuk Kim 2 participants 3 messages Oct 16, 2015 – Oct 19, 2015

Subsystems (2)
lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: convert inline_data for f2fs_fiemap

For fiemap, we should convert inline_data for user.

---
 fs/f2fs/data.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/f2fs/data.c +7 -0
index 77dfc9e..174a299 100644
@@ -771,6 +771,13 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
 	if (ret)
 		return ret;
 
+	/* we don't need to use inline_data strictly */
+	if (f2fs_has_inline_data(inode)) {
+		ret = f2fs_convert_inline_inode(inode);
+		if (ret)
+			return ret;
+	}
+
 	mutex_lock(&inode->i_mutex);
 
 	if (len >= isize) {
Signature · 1 line
2.1.1
#1 lore raw
Quoted 1 line · Jaegeuk Kim

For fiemap, we should convert inline_data for user.

Sorry for not answeriung your other mails, I'm busy, but I just saw this patch:

fs/f2fs/data.c int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · line 776

Quoted 3 lines
fs/f2fs/data.c +3 -0
+	/* we don't need to use inline_data strictly */
+	if (f2fs_has_inline_data(inode)) {
+		ret = f2fs_convert_inline_inode(inode);

If that means that fiemap is no longer read-only but changes the layout, by moving the data out of the inode, it's buggy - the correct way is to flag those extents with FIEMAP_EXTENT_DATA_INLINE (and/or possibly other flags).

I didn't investigate the code, so maybe I am completely off here, just guessing, really. If not, fiemap really is there to map the data extents, not to de-optimise the filesystem. It's especially bad as fiemap is used by a lot of tools to map disk layout.

If I am wrong, then please ignore my random mail here :)

Signature · 8 lines
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      [email protected]
      -=====/_/_//_/\_,_/ /_/\_\

------------------------------------------------------------------------------
author maintainer
#2 lore raw
Quoted 6 lines · Marc Lehmann
Quoted 1 line · Jaegeuk Kim

For fiemap, we should convert inline_data for user.

Sorry for not answeriung your other mails, I'm busy, but I just saw this patch:

Quoted 7 lines

fs/f2fs/data.c int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · line 776

Quoted 3 lines
fs/f2fs/data.c +3 -0
+	/* we don't need to use inline_data strictly */
+	if (f2fs_has_inline_data(inode)) {
+		ret = f2fs_convert_inline_inode(inode);

If that means that fiemap is no longer read-only but changes the layout, by moving the data out of the inode, it's buggy - the correct way is to flag those extents with FIEMAP_EXTENT_DATA_INLINE (and/or possibly other flags).

Cool, I found out it. :)
I submitted a patch to support that.

Thanks,

Quoted 21 lines

I didn't investigate the code, so maybe I am completely off here, just guessing, really. If not, fiemap really is there to map the data extents, not to de-optimise the filesystem. It's especially bad as fiemap is used by a lot of tools to map disk layout.

If I am wrong, then please ignore my random mail here :)

Signature · 12 lines
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      [email protected]
      -=====/_/_//_/\_,_/ /_/\_\

------------------------------------------------------------------------------
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

------------------------------------------------------------------------------