Re: changing ffs mount between rw and ro while preserving softdep

2014-08-28 Thread Boudewijn Dijkstra

Op Wed, 27 Aug 2014 20:50:34 +0200 schreef Miod Vallat m...@online.fr:

Why not keep the softdep flag when updating rw-ro?
E.g. via mount -ur /usr/obj
fstab(5) already allows ro+softdep.


Because if we were to apply this diff, there would be no way to switch
from rw+softdep to rw.


That was already broken; rw-rw is not affected as per the enclosing  
if-block.


I just tried this on 5.5 (GENERIC, without my diff):
# mount -vu -onosoftdep /usr/obj/
/dev/wd0f on /home type ffs (rw, local, noatime, nodev, nosuid, softdep,  
ctime=Thu Aug 28 11:04:07 2014)


And then after un-mounting and re-mounting without softdep:
# mount -vu -osoftdep /usr/obj/
/dev/sd0f on /usr/obj type ffs (rw, local, nodev, nosuid, ctime=Thu Aug 28  
11:12:57 2014)


So, currently it doesn't seem possible to turn softdep on or off with an  
rw mount.  My diff doesn't change that.



--
(Remove the obvious prefix to reply privately.)
Gemaakt met Opera's e-mailprogramma: http://www.opera.com/mail/



Re: changing ffs mount between rw and ro while preserving softdep

2014-08-28 Thread Miod Vallat

Because if we were to apply this diff, there would be no way to switch
from rw+softdep to rw.


That was already broken; rw-rw is not affected as per the enclosing  
 if-block.


Which is why the current way to remove softdep from a filesystem is a
rw+softdep - ro - rw transition, which would no longer work with your
diff.

Miod



Re: changing ffs mount between rw and ro while preserving softdep

2014-08-28 Thread Boudewijn Dijkstra

Op Thu, 28 Aug 2014 11:51:32 +0200 schreef Miod Vallat m...@online.fr:

Because if we were to apply this diff, there would be no way to switch
from rw+softdep to rw.


That was already broken; rw-rw is not affected as per the enclosing  
 if-block.


Which is why the current way to remove softdep from a filesystem is a
rw+softdep - ro - rw transition, which would no longer work with your
diff.


It would work, but you'd have to explicitly disable softdep, as one might  
expect to be required when removing softdep:

# mount -vuw /usr/obj
/dev/sd0f on /usr/obj type ffs (rw, local, nodev, nosuid, softdep,  
ctime=Thu Aug 28 11:58:27 2014)

# mount -vur -onosoftdep /usr/obj
/dev/sd0f on /usr/obj type ffs (local, nodev, nosuid, read-only, ctime=Thu  
Aug 28 11:58:40 2014)

# mount -vuw /usr/obj
/dev/sd0f on /usr/obj type ffs (rw, local, nodev, nosuid, ctime=Thu Aug 28  
11:58:50 2014)


Basically, I made my diff so that (mount -uw;mount -ur) cycles retain  
softdep.  Without my diff, one would have to append -osoftdep depending on  
the fs-type and what was defined in /etc/fstab.



--
(Remove the obvious prefix to reply privately.)
Gemaakt met Opera's e-mailprogramma: http://www.opera.com/mail/



Re: changing ffs mount between rw and ro while preserving softdep

2014-08-28 Thread Miod Vallat
 Which is why the current way to remove softdep from a filesystem is a
 rw+softdep - ro - rw transition, which would no longer work with your
 diff.
 
 It would work, but you'd have to explicitly disable softdep, as one might
 expect to be required when removing softdep:

Oh, indeed.

Then it's a matter of deciding whether we want mount -u to simply update
flags (and then only toggle ro/rw, and leave softdep unchanged) or to
update behaviour (and then clear softdep on rw-ro transition as softdep
do not apply to read-only filesystems). You're in favour of the former,
I am in favour of the latter. Who wants to be the referee?

Miod



Re: changing ffs mount between rw and ro while preserving softdep

2014-08-28 Thread Paul de Weerd
On Thu, Aug 28, 2014 at 06:27:48PM +, Miod Vallat wrote:
|  Which is why the current way to remove softdep from a filesystem is a
|  rw+softdep - ro - rw transition, which would no longer work with your
|  diff.
|  
|  It would work, but you'd have to explicitly disable softdep, as one might
|  expect to be required when removing softdep:
| 
| Oh, indeed.
| 
| Then it's a matter of deciding whether we want mount -u to simply update
| flags (and then only toggle ro/rw, and leave softdep unchanged) or to
| update behaviour (and then clear softdep on rw-ro transition as softdep
| do not apply to read-only filesystems). You're in favour of the former,
| I am in favour of the latter. Who wants to be the referee?

I hardly qualify as a referee but I'll add that I think Boudewijn's
approach makes more sense to me.  Even though I quite often use
-ur/-uw to drop softdep from filesystems.  Especially given
Boudewijn's point that putting ro,softdep in fstab results in a
filesystem that would get (still have) softdep after -uw.

I don't have very strong feelings on the matter (but, yes, strong
enough to write this e-mail ;)

Cheers,

Paul 'WEiRD' de Weerd

-- 
[++-]+++.+++[---].+++[+
+++-].++[-]+.--.[-]
 http://www.weirdnet.nl/ 



Re: changing ffs mount between rw and ro while preserving softdep

2014-08-28 Thread Alexander Hall

On 08/28/14 23:06, Paul de Weerd wrote:

On Thu, Aug 28, 2014 at 06:27:48PM +, Miod Vallat wrote:
|  Which is why the current way to remove softdep from a filesystem is a
|  rw+softdep - ro - rw transition, which would no longer work with your
|  diff.
| 
|  It would work, but you'd have to explicitly disable softdep, as one might
|  expect to be required when removing softdep:
|
| Oh, indeed.
|
| Then it's a matter of deciding whether we want mount -u to simply update
| flags (and then only toggle ro/rw, and leave softdep unchanged) or to
| update behaviour (and then clear softdep on rw-ro transition as softdep
| do not apply to read-only filesystems). You're in favour of the former,
| I am in favour of the latter. Who wants to be the referee?


I wouldn't expect any flags to change unless I ask for it, be it noexec, 
async, softdep or whatever.


/Alexander


I hardly qualify as a referee but I'll add that I think Boudewijn's
approach makes more sense to me.  Even though I quite often use
-ur/-uw to drop softdep from filesystems.  Especially given
Boudewijn's point that putting ro,softdep in fstab results in a
filesystem that would get (still have) softdep after -uw.

I don't have very strong feelings on the matter (but, yes, strong
enough to write this e-mail ;)




Cheers,

Paul 'WEiRD' de Weerd





changing ffs mount between rw and ro while preserving softdep

2014-08-27 Thread Boudewijn Dijkstra

Why not keep the softdep flag when updating rw-ro?
E.g. via mount -ur /usr/obj
fstab(5) already allows ro+softdep.


--- /usr/src/sys/ufs/ffs/ffs_vfsops.c.orig  Wed Aug 27 19:00:31 2014
+++ /usr/src/sys/ufs/ffs/ffs_vfsops.c   Wed Aug 27 19:01:19 2014
@@ -218,10 +218,9 @@
flags = WRITECLOSE;
if (mp-mnt_flag  MNT_FORCE)
flags |= FORCECLOSE;
-   if (fs-fs_flags  FS_DOSOFTDEP) {
+   if (fs-fs_flags  FS_DOSOFTDEP)
error = softdep_flushfiles(mp, flags, p);
-   mp-mnt_flag = ~MNT_SOFTDEP;
-   } else
+   else
error = ffs_flushfiles(mp, flags, p);
ronly = 1;
}



--
(Remove the obvious prefix to reply privately.)
Gemaakt met Opera's e-mailprogramma: http://www.opera.com/mail/



Re: changing ffs mount between rw and ro while preserving softdep

2014-08-27 Thread Miod Vallat
 Why not keep the softdep flag when updating rw-ro?
 E.g. via mount -ur /usr/obj
 fstab(5) already allows ro+softdep.

Because if we were to apply this diff, there would be no way to switch
from rw+softdep to rw.



Re: changing ffs mount between rw and ro while preserving softdep

2014-08-27 Thread Philip Guenther
On Wed, Aug 27, 2014 at 11:50 AM, Miod Vallat m...@online.fr wrote:

  Why not keep the softdep flag when updating rw-ro?
  E.g. via mount -ur /usr/obj
  fstab(5) already allows ro+softdep.

 Because if we were to apply this diff, there would be no way to switch
 from rw+softdep to rw.


And what exactly is the operational/behavioral difference between ro and
ro+softdep?


Re: changing ffs mount between rw and ro while preserving softdep

2014-08-27 Thread STeve Andre'

On 08/27/14 16:59, Philip Guenther wrote:

On Wed, Aug 27, 2014 at 11:50 AM, Miod Vallat m...@online.fr wrote:


Why not keep the softdep flag when updating rw-ro?
E.g. via mount -ur /usr/obj
fstab(5) already allows ro+softdep.

Because if we were to apply this diff, there would be no way to switch
from rw+softdep to rw.


And what exactly is the operational/behavioral difference between ro and
ro+softdep?


Extra code being executed when it doesn't have to be?

--STeve Andre'