Bug 17143

Summary: [PATCH] make "tunefs -p" work for mounted filesytems
Product: Base System Reporter: peter.edwards <peter.edwards>
Component: miscAssignee: Sheldon Hearn <sheldonh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
tunefs.patch none

Description peter.edwards 2000-03-03 11:10:03 UTC
tunefs -p won't work on a mounted filesystem.
Here's a patch that works for me

Fix: There's a check at the moment to check that a filesystem is mounted
R/W. If it is, tunefs exits prematurely. We need to avoid bailing out
at this point, and instead open the raw device in readonly mode
(otherwise we won't be able to open the device file, 'cause its busy)

Patch for /usr/src/sbin/tunefs/tunefs.c included

(uuencoded to keep whitespace for my cut-and-paste-to-web-browser)
How-To-Repeat: # tunefs -p /usr
tunefs: cannot work on read-write mounted file system
#
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-14 07:40:59 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

I'll take this one. 
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-14 07:49:43 UTC
State Changed
From-To: open->suspended

I committed an alternative patch, submitted by Luoqi Chen,  
as rev 1.12 of src/sbin/tunefs/tunefs.c .  I'll close the PR 
as soon as I've got permission to merge from Jordan and  
have done the merge. 
Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-27 12:53:24 UTC
State Changed
From-To: suspended->closed

Merged onto the RELENG_4 branch in rev 1.11.2.1.