The patch titled Subject: ocfs2: return non-zero st_blocks for inline data has been added to the -mm tree. Its filename is ocfs2-return-non-zero-st_blocks-for-inline-data.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-return-non-zero-st_blocks-for-inline-data.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-return-non-zero-st_blocks-for-inline-data.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: John Haxby <john.haxby@xxxxxxxxxx> Subject: ocfs2: return non-zero st_blocks for inline data Some versions of tar assume that files with st_blocks == 0 do not contain any data and will skip reading them entirely. See also commit 9206c561554c ("ext4: return non-zero st_blocks for inline data"). Signed-off-by: John Haxby <john.haxby@xxxxxxxxxx> Cc: Mark Fasheh <mfasheh@xxxxxxx> Cc: Joel Becker <jlbec@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/file.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN fs/ocfs2/file.c~ocfs2-return-non-zero-st_blocks-for-inline-data fs/ocfs2/file.c --- a/fs/ocfs2/file.c~ocfs2-return-non-zero-st_blocks-for-inline-data +++ a/fs/ocfs2/file.c @@ -1302,6 +1302,14 @@ int ocfs2_getattr(struct vfsmount *mnt, } generic_fillattr(inode, stat); + /* + * If there is inline data in the inode, the inode will normally not + * have data blocks allocated (it may have an external xattr block). + * Report at least one sector for such files, so tools like tar, rsync, + * others don't incorrectly think the file is completely sparse. + */ + if (unlikely(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL)) + stat->blocks += (stat->size + 511)>>9; /* We set the blksize from the cluster size for performance */ stat->blksize = osb->s_clustersize; _ Patches currently in -mm which might be from john.haxby@xxxxxxxxxx are ocfs2-return-non-zero-st_blocks-for-inline-data.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html