Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-09-01 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2:

Zhou, could you now add the minimal sleep that works for you, with a big link 
to the kernel bz#?

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: Sandro Bonazzola 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Wenyi Gao 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-09-01 Thread zhshzhou
Zhou Zheng Sheng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2:

Thanks Dan, the bug is at https://bugzilla.redhat.com/show_bug.cgi?id=853674 . 
I hope my little script could be helpful for the kernel developers.

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: Sandro Bonazzola 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Wenyi Gao 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-29 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2: (1 inline comment)

Please open a kernel bug on this issue, with all the details provided here, and 
your simple reproducer.

If we do not get a quick response from kernel guys, we could add a minimalist 
`sleep(0.1)` hack. (what's the minimum?)


File vdsm/mkimage.py
Line 83: m.mount(mntOpts='loop')
Line 84: try:
Line 85: _decodeFilesIntoDir(files, dirname)
Line 86: # flush changes to disk before we umount
Line 87: # otherwise umount raises "device busy" exception on some 
machines
0. gerrit ui re-wraps text paragraphs. To avoid that, add some indentation to a 
line in your paragraph. I admit that 
https://lists.fedorahosted.org/pipermail/vdsm-patches/2012-August/012152.html 
is much more readable... Gerrit ui does not fit very well to long comments as 
yours..

1. In my opinion,

 umount("/home/edward/src/tmpMount", MNT_FORCE) = -1 EBUSY (Device or resource 
busy)

is a kernel bug. AFAICT no process is holding open files when this is called. 
Would you open a BZ on kernel?
Line 88: storage.misc.syncFileSystem()
Line 89: finally:
Line 90: m.umount(force=True)
Line 91: finally:


--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: Sandro Bonazzola 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Wenyi Gao 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-27 Thread shaohef
ShaoHe Feng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2: Looks good to me, but someone else must approve

I also encounter this problem before. but strangely, this problem sometimes 
come ups, but it does not come ups for a long time.
it reproduces today.

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: Sandro Bonazzola 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Wenyi Gao 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-16 Thread zhshzhou
Zhou Zheng Sheng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2:

Dan, I've tested lazy umounts, it umounts successfully,  so mkimage.mkFloppyFs 
works well, but test_mkFloppyFs will fail.

test_mkFloppyFs firstly calls mkFloppyFs, and mkFloppyFs mounts a floppy image 
and write some files then umount it, then test_mkFloppyFs will mount the image 
again and check its contents. If I change the umount in mkFloppyFs to a lazy 
one, though it works, but when test_mkFloppyFs mounts again, it sees an empty 
filesystem so the check fails. I think this maybe because when umount lazily, 
the data is still in a kernel buffer waiting to be flushed to the image. Then 
we immediately mounts the image and the data is still not flushed, so we sees 
an empty filesystem.

I've done another experiment. Firstly, create a new file in the mounted image 
filesystem, then write some data, which is the same as what mkFloppyFs does, 
but before closing that new file, fsync the file descriptor, then use a lazy 
umount. Then umount succeeds and test_mkFloppyFs immediately mounts again and 
pass the check.

In a word, either fsync + lazy umount or sync + normal umount will work, and 
just lazy umount will not pass the contents check. I think this behaviour is 
very strange. The kernel is supposed to guarantee the data integrity, but we 
fail to check the file contents immediately after a lazy umount, how this can 
happen? I'm very confused.

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: Sandro Bonazzola 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-16 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2:

Zhou, I hate to suggest that, but would lazy umount hide the bug?

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: Sandro Bonazzola 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-15 Thread zhshzhou
Zhou Zheng Sheng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2: (1 inline comment)

@Sandro Bonazzola, thanks for the bugzilla information. I think this bug is not 
related to the bugs you pointed out. When those bugs are triggered, the loop 
device can not be umount until reboot, but my bug is that if we (sleep 2 
seconds | lsof the mount point | sync), umount will work. So it's a different 
bug.


File vdsm/mkimage.py
Line 83: m.mount(mntOpts='loop')
Line 84: try:
Line 85: _decodeFilesIntoDir(files, dirname)
Line 86: # flush changes to disk before we umount
Line 87: # otherwise umount raises "device busy" exception on some 
machines
0. Why some multi-line comments are displayed as one line? In the e-mail the 
text is correct, while in the web interface the multi-line comments turn into 
one line. What's going on?

1. my kernel version
Linux zhshzhouf17 3.5.1-1.fc17.x86_64 #1 SMP Thu Aug 9 17:50:43 UTC 2012 x86_64 
x86_64 x86_64 GNU/Linux

glibc version
glibc-2.15-51.fc17.x86_64

2. I wrote a script to reproduce the problem, this script mimics mkFloppyFs 
behavior.

#!/usr/bin/bash
mkdir tmpMount
/usr/sbin/mkfs.msdos -C floppy.img 1440
/usr/bin/mount -o loop floppy.img tmpMount
echo '123'>tmpMount/tst1.txt
echo '123'>tmpMount/tst2.txt
echo '123'>tmpMount/tst3.txt
echo '123'>tmpMount/tst4.txt
echo '123'>tmpMount/tst5.txt
echo '123'>tmpMount/tst6.txt
echo '123'>tmpMount/tst7.txt
echo '123'>tmpMount/tst8.txt
echo '123'>tmpMount/tst9.txt
/usr/bin/umount -f tmpMount
rm -rf tmpMount floppy.img


When I run the script, it prints as follow.
# LC_ALL=C ./testumount.sh
mkfs.msdos 3.0.12 (29 Oct 2011)
umount: /home/edward/src/tmpMount: target is busy.
(In some cases useful info about processes that use
 the device is found by lsof(8) or fuser(1))
rm: cannot remove `tmpMount': Device or resource busy

When I "lsof +D" the mount point, no one is occupying the directory and files, 
but there is a waring says "lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon 
file system /run/user/edward/gvfs Output information may be incomplete."

As long as this script fails to umount, mkFloppyFs will fail too.


3. Then I strace the mount and umount in the script, the results are as follow.

- mount.log -
execve("/usr/bin/mount", ["/usr/bin/mount", "-o", "loop", "floppy.img", 
"tmpMount"], [/* 52 vars */]) = 0
brk(0)  = 0x7fcbe8407000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fcbe7e56000
access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=135882, ...}) = 0
mmap(NULL, 135882, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fcbe7e34000
close(3)= 0
open("/lib64/libmount.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220x\0h:\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=183096, ...}) = 0
mmap(NULL, 2275512, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fcbe7a0c000
mprotect(0x7fcbe7a36000, 2097152, PROT_NONE) = 0
mmap(0x7fcbe7c36000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2a000) = 0x7fcbe7c36000
close(3)= 0
open("/lib64/libblkid.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240j\0F6\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=162496, ...}) = 0
mmap(NULL, 2255080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fcbe77e5000
mprotect(0x7fcbe7809000, 2093056, PROT_NONE) = 0
mmap(0x7fcbe7a08000, 16384, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x23000) = 0x7fcbe7a08000
close(3)= 0
open("/lib64/libuuid.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\26\200@6\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=21696, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fcbe7e33000
mmap(NULL, 2113960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fcbe75e
mprotect(0x7fcbe75e4000, 2093056, PROT_NONE) = 0
mmap(0x7fcbe77e3000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fcbe77e3000
close(3)= 0
open("/lib64/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300_\200:6\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=12, ...}) = 0
mmap(NULL, 2230304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fcbe73bf000
mprotect(0x7fcbe73dd000, 2093056, PROT_NONE) = 0
mmap(0x7fc

Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-15 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2: (1 inline comment)


File vdsm/mkimage.py
Line 83: m.mount(mntOpts='loop')
Line 84: try:
Line 85: _decodeFilesIntoDir(files, dirname)
Line 86: # flush changes to disk before we umount
Line 87: # otherwise umount raises "device busy" exception on some 
machines
Zhou, which kernel are you using? which libc? could you change mount.py to 
execute mount via strace, and capture some debug data from stderr?
Line 88: storage.misc.syncFileSystem()
Line 89: finally:
Line 90: m.umount(force=True)
Line 91: finally:


--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: Sandro Bonazzola 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread sandro . bonazzola
Sandro Bonazzola has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2:

I don't think that the umount failure is due to the writing of the data on the 
disk. I think that is something else: if no process is holding a refernce to a 
file in the mounted filesystem, umount should block until all data are written 
to disk. May it be something related to rhbz #758159 or rhbz #808795 ? Have you 
some indexing process running on the systems where the test is failing?

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: Sandro Bonazzola 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread zhshzhou
Zhou Zheng Sheng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2: (1 inline comment)


File vdsm/mkimage.py
Line 87: # otherwise umount raises "device busy" exception on some 
machines
I've done some experiment.

1. In _decodeFilesIntoDir, files are opened in a "with" block, so they are 
guaranteed to be closed.

2. If I fsync the files then close them, umount still fails.

3. If I let it sleep 2 seconds between _decodeFilesIntoDir and umount, umount 
works.

4. If I lsof the mount point between _decodeFilesIntoDir and umount, nothing 
will be printed, but umount works.

So I guess the driver/kernel holds the devices because the data is in the a 
kernel buffer but not written to disk. To get more information on this strange 
behaviour, I will try to have a look at my disk cache policy.

By the way, lsof gives the following waring when I lsof the mount point.
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system 
/run/user/edward/gvfs Output information may be incomplete

I have fuse and gvfs-fuse packages installed, but fuse.service can not be 
started. When I try to start the service, it fails and says "No such file or 
directory".

I don't know if the fuse problem is related to this problem.

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: Sandro Bonazzola 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread Gerrit Code Review
oVirt Jenkins CI Server has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2:

Build Successful 

http://jenkins.ovirt.info/job/vdsm_unit_tests_by_patch/30/ : SUCCESS

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread Gerrit Code Review
oVirt Jenkins CI Server has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2: No score

Build Started http://jenkins.ovirt.info/job/vdsm_unit_tests_by_patch/30/

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2: I would prefer that you didn't submit this

(1 inline comment)

thanks, but I'd like to understand the issue a bit better.


File vdsm/mkimage.py
Line 87: # otherwise umount raises "device busy" exception on some 
machines
could you understand why is the device busy? what is holding it? could you call 
`lsof` just before umount to catch them? maybe we should have closed f 
explicitly in _decodeFilesIntoDir?

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread zhshzhou
Zhou Zheng Sheng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 2: Verified

patch set 2: add some comments

Run through autobuild.sh and fix the problem for me.

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread zhshzhou
Zhou Zheng Sheng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 1:

Thanks mark and hejie. After collecting more advice, I will make a new patch 
set later.

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread zhshzhou
Zhou Zheng Sheng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 1:

I have tried lazy umount as well, it does not work. The test case will mount 
the image immediately after the previous umount, if I use lazy umount, the 
check will fail, because the data is not synced to the image yet. So I have to 
sync.

By the way, I tried fsync as well. The result is, if I fsync every file and 
close them, umount still throws exception. I have to fsync the files and umount 
lazyli to get it work. With fsync and a lazy umount, the data is written to the 
disk before umount, so when the test case mount again immediately, it checks 
the contents succesfully.

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread wudxw
Mark Wu has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 1:

I see there's an existing lazy option for the umount() function,  so it's 
easier to use lazy umount than sync.

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread zhshzhou
Zhou Zheng Sheng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 1: (1 inline comment)

Mark Wu, the problem is in the function "mkFloppyFs" in "vdsm/mkimage.py", not 
in the test case. The test case just calls "mkFloppyFs" and fail, so we can 
know there is a problem. As we write more test cases, we may reveal the same 
problem in other vdsm source files, so we may want to call sync in other files, 
that's why I add a function.


File vdsm/mkimage.py
Line 86: storage.misc.syncFileSystem()
Yes. Otherwise other programmers will get confused.

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread wudxw
Mark Wu has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 1: (1 inline comment)


File vdsm/mkimage.py
Line 86: storage.misc.syncFileSystem()
add a simple comment to explain why it needs a sync here?

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread wudxw
Mark Wu has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 1:

Is it necessary to add a new constant and a function to fix a problem in a test 
case?  How about just call sync in the test case?

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Mark Wu 
Gerrit-Reviewer: ShaoHe Feng 
Gerrit-Reviewer: Zhou Zheng Sheng 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread zhshzhou
Zhou Zheng Sheng has posted comments on this change.

Change subject: call sync before umount in mkFloppyFs
..


Patch Set 1:

This problem causes unit test "test_mkFloppyFs" in "tests/mkimageTests.py" fail.

My uname -a is as follow,
Linux zhshzhouf17 3.5.0-2.fc17.x86_64 #1 SMP Mon Jul 30 14:48:59 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux

On my system if I umount immediately after wrting file contents, umount will 
fail. To reproduce the problem, you can use the script below. The script mimics 
what mkFloppyFs does.

#!/usr/bin/bash
mkdir tmpMount
/usr/sbin/mkfs.msdos -C floppy.img 1440
/usr/bin/mount -o loop floppy.img tmpMount
echo '123'>tmpMount/tst1.txt
echo '123'>tmpMount/tst2.txt
echo '123'>tmpMount/tst3.txt
echo '123'>tmpMount/tst4.txt
echo '123'>tmpMount/tst5.txt
echo '123'>tmpMount/tst6.txt
echo '123'>tmpMount/tst7.txt
echo '123'>tmpMount/tst8.txt
echo '123'>tmpMount/tst9.txt
#sleep 2
/usr/bin/umount -f tmpMount
rm -rf tmpMount floppy.img

When I run the script, umount fails. On some other machine of VM, the script 
may not fail.
If I uncomment the "sleep" command in the script, umount works again. This 
means some data need to be sync to disk, so the device is busy, and umount can 
not detach the devices. On my system, if I sync before umount, umount will 
work. Some of my colleagues run into this problem as well.

The patch run through autobuild.sh

--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
Gerrit-Reviewer: Zhou Zheng Sheng 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: call sync before umount in mkFloppyFs

2012-08-08 Thread zhshzhou
Zhou Zheng Sheng has uploaded a new change for review.

Change subject: call sync before umount in mkFloppyFs
..

call sync before umount in mkFloppyFs

mkFloppyFs creates a floppy image, mount it, write some content, and
umount the image. On some systems, if we umount immediately after writing
content, umount will fail, because the data is not fully synced to disk,
and the device is still busy. This problem causes unit test test_mkFloppyFs
in mkimageTests.py fail.

To avoid the busy device problem, call /usr/bin/sync before umount.

Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Signed-off-by: Zhou Zheng Sheng 
---
M configure.ac
M vdsm/constants.py.in
M vdsm/mkimage.py
M vdsm/storage/misc.py
4 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/6995/1
--
To view, visit http://gerrit.ovirt.org/6995
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I708e70aa1e898b32bb3c1009d411389d7adbe549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches