Bug 853674 - mount a loop device to write some file, and umount immediately will fail
Summary: mount a loop device to write some file, and umount immediately will fail
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 19
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 855274
TreeView+ depends on / blocked
 
Reported: 2012-09-02 04:03 UTC by Zhou Zheng Sheng
Modified: 2013-10-08 17:40 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
: 855274 (view as bug list)
Environment:
Last Closed: 2013-10-08 17:40:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
strace -f ./testumount.sh >testumount.txt 2>&1 (60.72 KB, text/plain)
2012-09-02 04:03 UTC, Zhou Zheng Sheng
no flags Details
Comment (97.59 KB, text/plain)
2012-09-03 02:39 UTC, Zhou Zheng Sheng
no flags Details

Description Zhou Zheng Sheng 2012-09-02 04:03:54 UTC
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):
uname -a:
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:
glibc-2.15-56.fc17.x86_64


How reproducible:
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/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
  
Actual results:
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

Expected results:
The device can be umounted and no error are reported.

Additional info:
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.

4. strace
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

Comment 1 Dan Kenigsberg 2012-09-02 05:50:04 UTC
Could you check if this is also the case with other filesystems, or only with mkfs.msdos ?

Comment 2 Zhou Zheng Sheng 2012-09-02 11:02:12 UTC
Thanks for the quick reply. I tested ext2, ext3, ext4 and vfat images, all can reproduce this bug.

Comment 3 Dan Kenigsberg 2012-09-02 21:42:39 UTC
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?

Comment 4 Zhou Zheng Sheng 2012-09-03 02:39:53 UTC
Created attachment 915488 [details]
Comment

(This comment was longer than 65,535 characters and has been moved to an attachment by Red Hat Bugzilla).

Comment 5 Mark Wu 2012-09-07 07:29:28 UTC
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.

Comment 6 Josh Boyer 2012-10-08 15:05:08 UTC
There is a patch submitted upstream that sounds like it might be related to this problem:

http://thread.gmane.org/gmane.linux.kernel/1365998

We'll keep an eye on it and see if it's merged soon.

Comment 7 Fedora End Of Life 2013-07-04 06:00:41 UTC
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.

Comment 8 Fedora End Of Life 2013-08-01 17:22:27 UTC
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.

Comment 9 Mark Wu 2013-08-05 02:11:41 UTC
Still reproducible on F19 with the script in problem description.
Kernel version: 3.10.3-300.fc19.x86_64

Comment 10 Josh Boyer 2013-09-18 20:40:39 UTC
*********** 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.

Comment 11 Josh Boyer 2013-10-08 17:40:56 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.