Bug 458068

Summary: mount hangs while mounting ntfs partition
Product: [openSUSE] openSUSE 11.1 Reporter: Stefan Assmann <sassmann>
Component: GNOMEAssignee: Matthias Koenig <mkoenig>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P1 - Urgent CC: cus, szaka
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: Linux   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 433187    
Attachments: strace

Description Stefan Assmann 2008-12-10 18:26:27 UTC
Created attachment 259227 [details]
strace

sassmann@samsung:~> ps fax |grep mount
 4120 pts/1    S+     0:00  |               \_ strace -o /tmp/mount.strace -f -tt -s 512 mount /dev/sda1 /mnt/
 4121 pts/1    T+     0:00  |                   \_ mount /dev/sda1 /mnt/
 4122 pts/1    T+     0:00  |                       \_ /sbin/mount.ntfs /dev/sda1 /mnt/ -o rw
 4124 pts/1    S+     0:00  |                           \_ /bin/mount -i -f -t fuseblk -o rw,allow_other,blksize=4096 /dev/sda1 /mnt

hangs indefinetly, does not respond to ^C
Comment 1 Cyril Hrubis 2008-12-11 13:41:24 UTC
Strace ends in fnctl -> probably kernel problem.
Comment 2 Philipp Zimmer 2008-12-21 11:22:49 UTC
This seems to be a ntfs-3g problem. I have the same issue, but this works:

rizzle@rizzlem:/tmp> sudo mount -t ntfs /dev/sda2 /mnt/
Comment 3 Philipp Zimmer 2008-12-21 12:32:06 UTC
As I just noticed mounting with -t ntfs also uses fuseblk - but works. Mounting the same partition _without_ specifying -t ntfs does not work.
Comment 4 Jeff Mahoney 2009-01-06 19:48:49 UTC
Cyril Hrubis)
> Strace ends in fnctl -> probably kernel problem.

[pid   967] open("/etc/mtab~", O_WRONLY) = 6
[pid   967] alarm(30)                   = 0
[pid   967] fcntl(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}

Nope. F_SETLKW means it's requesting a POSIX file lock, and is waiting on the lock to be released. The lock is for /etc/mtab~. The kernel is not hanging and the process can be killed via kill -9.

x300:/proc # ls -li /etc/mtab~
277047 -rw------- 1 root root 0 Jan  6 14:35 /etc/mtab~

x300:/proc # cat locks
....
2: POSIX  ADVISORY  WRITE 964 fd:01:277047 0 EOF
2: -> POSIX  ADVISORY  WRITE 967 fd:01:277047 0 EOF

x300:/proc # ps auxw|grep 964
root       964  0.0  0.0  12768   968 pts/1    T+   14:35   0:00 mount /dev/sda1 /mnt

This is because the call path looks like:

mount -> mount.ntfs -> mount, with both mount calls trying to lock /etc/mtab~. mount.ntfs is causing the "reentrant" behavior, so I'll assign to the gnome component. Adding util-linux maintainer to cc.
Comment 5 Szabolcs Szakacsits 2009-01-15 16:06:08 UTC
Please somebody send the content of /sbin/mount.ntfs. Thank you.
Comment 6 Matthias Koenig 2009-01-15 16:15:44 UTC
This is a bug in mount, a regression of bug 444966 and already fixed.
There was a code path in mount, where the lock was not released before calling the mount helper.
Please see bug 459839.
Comment 7 Matthias Koenig 2009-01-15 16:17:31 UTC
update for openSUSE 11.1 is also pending.
Comment 8 Szabolcs Szakacsits 2009-01-27 21:06:40 UTC
(In reply to comment #6)
> This is a bug in mount, a regression of bug 444966 and already fixed.
> There was a code path in mount, where the lock was not released before calling
> the mount helper.
> Please see bug 459839.

Access Denied.