Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Dec 2000 09:28:43 -0800
From:      Julian Elischer <julian@elischer.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        arch@FreeBSD.ORG
Subject:   Re: inheriting the "nodump" flag ?
Message-ID:  <3A33BD4B.B078C3E3@elischer.org>
References:  <98900.976464081@critter>

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:
> 
> In message <97286.976447504@critter>, Poul-Henning Kamp writes:
> >
> >I don't know how many of you know or even use the "nodump" file flag.
> >
> >It's utility is somewhat limited by the fact that it is not
> >inherited from the parent directory.
> >
> >I like to mark my cvs tree as "nodump", there is no point in backing
> >it up for me.
> >
> >Unfortunately, since the nodump flag is not inherited on creation
> >I need to run "chflags -R nodump /home/ncvs" first every time I want
> >to make a backup.
> >
> >I would like to propose that directories and files inherit the
> >nodump flag if it is set on the directory they are created in.
> >
> >Comments ? protests ?
> 
> Attached is the surprisingly simple patch to implement this in ufs.


I think this badly breaks POLA and I am actively against it.

As a default behaviour it is bad because:
All files get broken up into several classes:

1/ old files in such a directory (dumped)
2/ new files in such a directory (not dumped)
3/ any files in an old subdirectory (dumped)
4/ any files in a new subdirectory (not dumped)

This behaviour is not intuitive to the average user who will expect a 
'don't dump' on a directory to prune that directory from the dump contents.
to fix it you must ALWAYS do a chflags -R which is an extra step
which can easily be |forgotten leading to confusion.

the answer is to fix DUMP, or use `find . -flags ....|cpio`


DUMP is the odd man out here by having a broken tree walker.

If anyone else suggested this you'd be screaming bloody murder.

> 
> Index: ufs/ufs/ufs_vnops.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/ufs/ufs/ufs_vnops.c,v
> retrieving revision 1.154
> diff -u -r1.154 ufs_vnops.c
> --- ufs/ufs/ufs_vnops.c 2000/11/04 08:10:56     1.154
> +++ ufs/ufs/ufs_vnops.c 2000/12/10 15:30:25
> @@ -1355,6 +1355,7 @@
>  #endif
>  #endif /* !SUIDDIR */
>         ip->i_flag |= IN_ACCESS | IN_CHANGE | IN_UPDATE;
> +       ip->i_flags |= (dp->i_flags & UF_NODUMP);
>         ip->i_mode = dmode;
>         tvp->v_type = VDIR;     /* Rest init'd in getnewvnode(). */
>         ip->i_effnlink = 2;
> @@ -2071,6 +2072,7 @@
>                 return (error);
>         ip = VTOI(tvp);
>         ip->i_gid = pdir->i_gid;
> +       ip->i_flags |= (pdir->i_flags & UF_NODUMP);
>  #ifdef SUIDDIR
>         {
>  #ifdef QUOTA
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk@FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-arch" in the body of the message

-- 
      __--_|\  Julian Elischer
     /       \ julian@elischer.org
    (   OZ    ) World tour 2000
---> X_.---._/  presently in:  Budapest
            v


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




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