Red Hat Bugzilla – Bug 853674
mount a loop device to write some file, and umount immediately will fail
Last modified: 2013-10-08 13:40:56 EDT
Created attachment 609013 [details]
strace -f ./testumount.sh >testumount.txt 2>&1
Description of problem:
Mount a floppy image, and write some files, then immediately umount. The umount will fail.
Version-Release number of selected component (if applicable):
Linux zhshzhouf17 3.5.2-3.fc17.x86_64 #1 SMP Tue Aug 21 19:06:52 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
rpm -q glibc:
On my machine, always, on kernel 3.4 and 3.5 release. Other release are not tested. On some of my colleagues's machines, it can be reproduced. It can not be reporduced on virtual machines.
Steps to Reproduce:
1. I write a script to reproduce the problem.
/usr/sbin/mkfs.msdos -C floppy.img 1440
/usr/bin/mount -o loop floppy.img tmpMount
/usr/bin/umount -f tmpMount
rm -rf tmpMount floppy.img
When I run the script, umount fails. The script prints some error message as follow.
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
The device can be umounted and no error are reported.
1. sleep several seconds before umount
If I uncomment the "sleep" command in the script, umount works again. This means data is waiting 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.
2. lsof the mount point prints nothing
If I lsof the mount point between before umount, nothing will be printed, but umount works again
So I guess the driver/kernel holds the devices because the data is in the a kernel buffer but not written to disk.
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.
3. lazy umount does not work, but fsync + lazy umount works
When I use lazy umount in the script, it works. However when I let the script mount the image again immediately, the image contains nothing. The image should contain the files created by the script.
When I fsync the FDs of those files before the lazy umount, umount successed. Then I mount the image again immediately, I can see the files there.
The detialed strace report is in the attachment. I use the following command to generate that report.
strace -f ./testumount.sh >testumount.txt 2>&1
Could you check if this is also the case with other filesystems, or only with mkfs.msdos ?
Thanks for the quick reply. I tested ext2, ext3, ext4 and vfat images, all can reproduce this bug.
A kernel developer failed to reproduce the issue on his system today. Could you give more details on the hosts where this shows up? Which storage is backing your filesystem? Is there a host where you can grant access to a developer?
Created attachment 915488 [details]
(This comment was longer than 65,535 characters and has been moved to an attachment by Red Hat Bugzilla).
I can reproduce this problem, and the problem disappear after I kill the process of gvfsd-trash. It looks it's the same problem reported in: http://code.google.com/p/chromium-os/issues/detail?id=23443.
So I think we should ask gvfs guys take a look at first.
BTW, Zhengsheng, it's bad to paste such a long comment. You could upload it as attachment.
There is a patch submitted upstream that sounds like it might be related to this problem:
We'll keep an eye on it and see if it's merged soon.
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.
Still reproducible on F19 with the script in problem description.
Kernel version: 3.10.3-300.fc19.x86_64
*********** MASS BUG UPDATE **************
We apologize for the inconvenience. There is a large number of bugs to go through and several of them have gone stale. Due to this, we are doing a mass bug update across all of the Fedora 19 kernel bugs.
Fedora 19 has now been rebased to 3.11.1-200.fc19. Please test this kernel update and let us know if you issue has been resolved or if it is still present with the newer kernel.
If you experience different issues, please open a new bug report for those.
This bug is being closed with INSUFFICIENT_DATA as there has not been a response in 2 weeks. If you are still experiencing this issue, please reopen and attach the relevant data from the latest kernel you are running and any data that might have been requested previously.