Bug 120483 - [ntfs] [patch] NTFS filesystem locking changes
Summary: [ntfs] [patch] NTFS filesystem locking changes
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-09 20:30 UTC by Scot Hetzel
Modified: 2014-08-11 18:39 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (8.27 KB, patch)
2008-02-09 20:30 UTC, Scot Hetzel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scot Hetzel 2008-02-09 20:30:01 UTC
After the lockmgr changes on  Jan 08 23:49 UTC 2008, when a NTFS filesystem is mounted a panic will occur:

panic: System call lstat returning with 1 locks held
 cpuid = 0
 KDB: enter: panic
 [thread ; pid 1240 tid 10031]
 stopped at kdb_enter+0x3d: movq $0,0x41b048(%rip)
 db> show alllocks
 db> show locks
 db> bt
 tracing pid 1240 tid 10031 td 0xffffff001c1ad360
 kdb_enter() at kdb_enter+0x3d
 panic() at panic+0x176
 syscalls() at syscalls+0x66d
 Xfast_syscalls() at Xfast_syscalls+0xab
 --- syscall (0, FreeBSD ELF64, nosys), rip = 0x8009e87ec, rsp=
 0x72ec50, rbp = 0x72ed28 ---
 
even though the NTFS filesystem wasn't being accessed at the time.

Through the help of Attilio Rao (who had made the changes to lockmgr), and several other users experiencing the problem, we were able to isolate the problem to the NTFS filesystem as the cause of the problem.

Fix: I looked at the NetBSD NTFS implementation and noticed that they had replaced the lockmgr locking with mutex locking.

After porting the lockmgr -> mutex related changes to FreeBSD, I can no longer cause these panics to occur with a mounted NTFS filesystem after applying the attached patch.

Patch attached with submission follows:
How-To-Repeat: There are several ways to cause the panic:

Running PREFIX/etc/cvsup/update.sh from a non-NTFS filesystem
Running find on a non-NTFS filesystem (cd /usr/ports ; find . -print) or on the NTFS filesystem.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-05-18 05:26:08 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 joeb1 2014-07-12 02:01:48 UTC
Close this pr.
8.0 is past EOL as this pr is now meaningless.
And ntfs has been removed from 10.0 base see
http://svnweb.freebsd.org/base/head/sbin/Makefile?view=log&pathrev=247665
Comment 3 John Baldwin freebsd_committer freebsd_triage 2014-08-11 18:39:36 UTC
NTFS is no longer in the base system.