Hide Forgot
Description of problem: # Using exact same setup from bug 1376562 Verify/read all files previously written: [root@host-117 ~]# /usr/tests/sts-rhel7.3/bin/checkit -w /mnt/lvol0 -f /tmp/checkio -v checkit starting with: VERIFY Verify XIOR Stream: /tmp/checkio Working dir: /mnt/lvol0 [root@host-117 ~]# /usr/tests/sts-rhel7.3/bin/checkit -w /mnt/lvol0 -f /tmp/checkio -v checkit starting with: VERIFY Verify XIOR Stream: /tmp/checkio Working dir: /mnt/lvol0 [root@host-117 ~]# /usr/tests/sts-rhel7.3/bin/checkit -w /mnt/lvol0 -f /tmp/checkio -v checkit starting with: VERIFY Verify XIOR Stream: /tmp/checkio Working dir: /mnt/lvol0 [root@host-117 ~]# /usr/tests/sts-rhel7.3/bin/checkit -w /mnt/lvol0 -f /tmp/checkio -v checkit starting with: VERIFY Verify XIOR Stream: /tmp/checkio Working dir: /mnt/lvol0 # No change in stat performance [root@host-117 ~]# dmstats report --group Name GrpID RgID ObjType ArID ArStart ArSize RMrg/s WMrg/s R/s W/s RSz/s WSz/s AvgRqSz QSize Util% AWait RdAWait WrAWait xjjcmoeftdcathggnism 0 0 group 0 8.63m 250.00k 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00 0.00 0.00 0.00 vntwhckfhujdlh 1 1 group 0 9.36m 175.00k 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00 0.00 0.00 0.00 # over write the file completely [root@host-117 ~]# cp /root/anaconda-ks.cfg /mnt/lvol0/xjjcmoeftdcathggnism cp: overwrite â/mnt/lvol0/xjjcmoeftdcathggnismâ? y [root@host-117 ~]# sync [root@host-117 ~]# echo 3 > /proc/sys/vm/drop_caches # No change [root@host-117 ~]# dmstats report --group Name GrpID RgID ObjType ArID ArStart ArSize RMrg/s WMrg/s R/s W/s RSz/s WSz/s AvgRqSz QSize Util% AWait RdAWait WrAWait xjjcmoeftdcathggnism 0 0 group 0 8.63m 250.00k 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00 0.00 0.00 0.00 vntwhckfhujdlh 1 1 group 0 9.36m 175.00k 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00 0.00 0.00 0.00 # write and read zeros over and over [root@host-117 ~]# for i in $(seq 0 20) > do > dd if=/dev/zero of=/mnt/lvol0/xjjcmoeftdcathggnism oflag=direct,sync bs=1M count=15 > dd if=/mnt/lvol0/xjjcmoeftdcathggnism of=/dev/null iflag=direct,sync bs=1M count=15 > done # No change [root@host-117 ~]# dmstats report --group Name GrpID RgID ObjType ArID ArStart ArSize RMrg/s WMrg/s R/s W/s RSz/s WSz/s AvgRqSz QSize Util% AWait RdAWait WrAWait xjjcmoeftdcathggnism 0 0 group 0 8.63m 250.00k 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00 0.00 0.00 0.00 vntwhckfhujdlh 1 1 group 0 9.36m 175.00k 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00 0.00 0.00 0.00 [root@host-117 ~]# echo 3 > /proc/sys/vm/drop_caches [root@host-117 ~]# sync # Still no change [root@host-117 ~]# dmstats report --group Name GrpID RgID ObjType ArID ArStart ArSize RMrg/s WMrg/s R/s W/s RSz/s WSz/s AvgRqSz QSize Util% AWait RdAWait WrAWait xjjcmoeftdcathggnism 0 0 group 0 8.63m 250.00k 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00 0.00 0.00 0.00 vntwhckfhujdlh 1 1 group 0 9.36m 175.00k 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00 0.00 0.00 0.00 Version-Release number of selected component (if applicable): 3.10.0-501.el7.x86_64 lvm2-2.02.165-2.el7 BUILT: Wed Sep 14 09:01:43 CDT 2016 lvm2-libs-2.02.165-2.el7 BUILT: Wed Sep 14 09:01:43 CDT 2016 lvm2-cluster-2.02.165-2.el7 BUILT: Wed Sep 14 09:01:43 CDT 2016 device-mapper-1.02.134-2.el7 BUILT: Wed Sep 14 09:01:43 CDT 2016 device-mapper-libs-1.02.134-2.el7 BUILT: Wed Sep 14 09:01:43 CDT 2016 device-mapper-event-1.02.134-2.el7 BUILT: Wed Sep 14 09:01:43 CDT 2016 device-mapper-event-libs-1.02.134-2.el7 BUILT: Wed Sep 14 09:01:43 CDT 2016 device-mapper-persistent-data-0.6.3-1.el7 BUILT: Fri Jul 22 05:29:13 CDT 2016
I think the reason you're not actually re-writing the file - by default I think cp will unlink the destination and open(2) a new file, where dd does open the existing file, but using O_CREAT|O_TRUNC (i.e. all existing extents are released): lseek(0, 0, SEEK_CUR) = 0 open("/var/tmp/foo", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3 dup2(3, 1) = 1 This will be fixed when we implement inode monitoring and automatic refresh of the region table but until then we can only support in-place IO.
We should note this in the man page/release notes, or a kbase article - it's going to be fairly common with tools like cp/dd and is confusing for the user.
*** This bug has been marked as a duplicate of bug 1378956 ***