Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Mar 2000 03:03:50 -0800 (PST)
From:      peter.edwards@ireland.com
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/17143: [PATCH] make "tunefs -p" work for mounted filesytems
Message-ID:  <200003031103.DAA32613@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         17143
>Category:       misc
>Synopsis:       [PATCH] make "tunefs -p" work for mounted filesytems
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar  3 03:10:03 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Peter Edwards
>Release:        -current
>Organization:
>Environment:
FreeBSD rocklobster 4.0-CURRENT FreeBSD 4.0-CURRENT #3:
Fri Jan 21 09:42:06 GMT 2000     
petere@rocklobster:/usr/src/sys/compile/PME2  i386

>Description:
tunefs -p won't work on a mounted filesystem.
Here's a patch that works for me

>How-To-Repeat:
# tunefs -p /usr
tunefs: cannot work on read-write mounted file system
#
>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)

begin 644 tunefs.patch
M*BHJ('1U;F5F<RYC+F]R:6<)1G)I($UA<B`@,R`Q,#HS,3HQ."`R,#`P"BTM
M+2!T=6YE9G,N8PE&<FD@36%R("`S(#$P.C0U.C4R(#(P,#`**BHJ*BHJ*BHJ
M*BHJ*BHJ"BHJ*B`W-RPX-R`J*BHJ"B`@"B`@=F]I9"!B=W)I=&4H9&%D9')?
M="P@8VAA<B`J+"!I;G0I.PH@(&EN="!B<F5A9"AD861D<E]T+"!C:&%R("HL
M(&EN="D["B$@=F]I9"!G971S8BAS=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FEL92D*("`)<F5G:7-T97(@<W1R=6-T(&9S("IF<SL*("`)8VAA
M<B`J9FEL93L*("!["B`@"B$@"69I(#T@;W!E;BAF:6QE+"`R*3L*("`):68@
M*&9I(#P@,"D*("`)"65R<B@S+"`B8V%N;F]T(&]P96X@)7,B+"!F:6QE*3L*
M("`):68@*&)R96%D*"AD861D<E]T*5-"3T9&+"`H8VAA<B`J*69S+"!30E-)
M6D4I*0HM+2T@,C@U+#(Y-R`M+2TM"B`@?0H@(`H@('9O:60*(2!G971S8BAF
M<RP@9FEL92P@;6]D92D*("`)<F5G:7-T97(@<W1R=6-T(&9S("IF<SL*("`)
M8VAA<B`J9FEL93L**R`):6YT(&UO9&4["B`@>PH@(`HA(`EF:2`](&]P96XH
M9FEL92P@;6]D92D["B`@"6EF("AF:2`\(#`I"B`@"0EE<G(H,RP@(F-A;FYO
M="!O<&5N("5S(BP@9FEL92D["B`@"6EF("AB<F5A9"@H9&%D9')?="E30D]&
81BP@*&-H87(@*BEF<RP@4T)325I%*2D*
`
end


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003031103.DAA32613>