summaryrefslogtreecommitdiff
path: root/fs/ocfs2/ocfs2_trace.h
diff options
context:
space:
mode:
authorJie Liu <jeff.liu@oracle.com>2013-09-11 21:20:05 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 22:56:53 (GMT)
commit28e8be31803b19d0d8f76216cb11b480b8a98bec (patch)
tree9edd81d3a6c0029e18da8a6c017f6cf087302d14 /fs/ocfs2/ocfs2_trace.h
parenta72e27d3727b383be39498f8b5c9b944d30e0f9b (diff)
downloadlinux-fsl-qoriq-28e8be31803b19d0d8f76216cb11b480b8a98bec.tar.xz
ocfs2: fix the end cluster offset of FIEMAP
Call fiemap ioctl(2) with given start offset as well as an desired mapping range should show extents if possible. However, we somehow figure out the end offset of mapping via 'mapping_end -= cpos' before iterating the extent records which would cause problems if the given fiemap length is too small to a cluster size, e.g, Cluster size 4096: debugfs.ocfs2 1.6.3 Block Size Bits: 12 Cluster Size Bits: 12 The extended fiemap test utility From David: https://gist.github.com/anonymous/6172331 # dd if=/dev/urandom of=/ocfs2/test_file bs=1M count=1000 # ./fiemap /ocfs2/test_file 4096 10 start: 4096, length: 10 File /ocfs2/test_file has 0 extents: # Logical Physical Length Flags ^^^^^ <-- No extent is shown In this case, at ocfs2_fiemap(): cpos == mapping_end == 1. Hence the loop of searching extent records was not executed at all. This patch remove the in question 'mapping_end -= cpos', and loops until the cpos is larger than the mapping_end as usual. # ./fiemap /ocfs2/test_file 4096 10 start: 4096, length: 10 File /ocfs2/test_file has 1 extents: # Logical Physical Length Flags 0: 0000000000000000 0000000056a01000 0000000006a00000 0000 Signed-off-by: Jie Liu <jeff.liu@oracle.com> Reported-by: David Weber <wb@munzinger.de> Tested-by: David Weber <wb@munzinger.de> Cc: Sunil Mushran <sunil.mushran@gmail.com> Cc: Mark Fashen <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/ocfs2_trace.h')
0 files changed, 0 insertions, 0 deletions