git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
  • * Re: Index/hash order
           [not found]                       ` <20050413182909.GA25221@elte.hu>
           [not found]                         ` <Pine.LNX.4.58.0504131144160.4501@ppc970.osdl.org>
    @ 2005-04-13 20:28                         ` Baruch Even
      1 sibling, 0 replies; 23+ messages in thread
    From: Baruch Even @ 2005-04-13 20:28 UTC (permalink / raw)
      To: Ingo Molnar; +Cc: Linus Torvalds, H. Peter Anvin, git
    
    Ingo Molnar wrote:
    > with a plaintext repository we could do the 'hardlink trick' (which 
    > brings in other manageability problems and limitations but is at least a 
    > partially good idea), which would make the working tree and the 
    > repository share the same inode in most cases.
    > 
    > While in the compressed case we'd have a separate compressed inode 
    > (taking up RAM with all its contents) and the working directory inode 
    > (taking up RAM) - summing up to more RAM than if we only had a single 
    > inode per object.
    > 
    > furthermore, when generating/destroying large trees (which is a quite 
    > common thing), a hardlinked solution is faster, as it doesnt create 
    > 250MB+ of dirty RAM. In some cases (e.g. handling dozens of 'merge 
    > trees') it's dramatically faster.
    
    You could still have the hardlink way by way of a .git/cache that keeps 
    uncompressed files, keep the files with their hash names but uncompressed.
    
    It will be easy to find, fully hard-linkable, only keep the needed files 
      uncompressed and the three year old file compressed. The
    
    You can even save some CPU time by checking if the file is in the cache 
    before decompressing it, though it does cost you with an extra disk 
    access to see if it's there or not. If you repeat the operation enough 
    you'll have the uncompressed version in the cache most of the times anyway.
    
    Clear the cache weekly or so to avoid stale files from an ancient version.
    
    Baruch
    
    ^ permalink raw reply	[flat|nested] 23+ messages in thread
  • [parent not found: <Pine.LNX.4.58.0504131008500.4501@ppc970.osdl.org>]
  • * Re: enforcing DB immutability
    @ 2005-04-20  8:41 linux
      2005-04-20 15:57 ` Erik Mouw
      2005-04-22 16:10 ` Bill Davidsen
      0 siblings, 2 replies; 23+ messages in thread
    From: linux @ 2005-04-20  8:41 UTC (permalink / raw)
      To: git, linux-kernel; +Cc: mingo
    
    [A discussion on the git list about how to provide a hardlinked file
    that *cannot* me modified by an editor, but must be replaced by
    a new copy.]
    
    mingo@elte.hu wrote all of:
    >>> perhaps having a new 'immutable hardlink' feature in the Linux VFS 
    >>> would help? I.e. a hardlink that can only be readonly followed, and 
    >>> can be removed, but cannot be chmod-ed to a writeable hardlink. That i 
    >>> think would be a large enough barrier for editors/build-tools not to 
    >>> play the tricks they already do that makes 'readonly' files virtually 
    >>> meaningless.
    >> 
    >> immutable hardlinks have the following advantage: a hardlink by design 
    >> hides the information where the link comes from. So even if an editor 
    >> wanted to play stupid games and override the immutability - it doesnt 
    >> know where the DB object is. (sure, it could find it if it wants to, 
    >> but that needs real messing around - editors wont do _that_)
    >
    > so the only sensible thing the editor/tool can do when it wants to 
    > change the file is precisely what we want: it will copy the hardlinked 
    > files's contents to a new file, and will replace the old file with the 
    > new file - a copy on write. No accidental corruption of the DB's 
    > contents.
    
    This is not a horrible idea, but it touches on another sore point I've
    worried about for a while.
    
    The obvious way to do the above *without* changing anything is just to
    remove all write permission to the file.  But because I'm the owner, some
    piece of software running with my permissions can just deicde to change
    the permissions back and modify the file anyway.  Good old 7th edition
    let you give files away, which could have addressed that (chmod a-w; chown
    phantom_user), but BSD took that ability away to make accounting work.
    
    The upshot is that, while separate users keeps malware from harming the
    *system*, if I run a piece of malware, it can blow away every file I
    own and make me unhappy.  When (notice I'm not saying "if") commercial
    spyware for Linux becomes common, it can also read every file I own.
    
    Unless I have root access, Linux is no safer *for me* than Redmondware!
    
    Since I *do* have root access, I often set up sandbox users and try
    commercial binaries in that environment, but it's a pain and laziness
    often wins.  I want a feature that I can wrap in a script, so that I
    can run a commercial binary in a nicely restricted enviromment.
    
    Or maybe I even want to set up a "personal root" level, and run
    my normal interactive shells in a slightly restricted enviroment
    (within which I could make a more-restricted world to run untrusted
    binaries).  Then I could solve the immutable DB issue by having a
    "setuid" binary that would make checked-in files unwriteable at my
    normal permission level.
    
    Obviously, a fundamental change to the Unix permissions model won't
    be available to solve short-term problems, but I thought I'd raise
    the issue to get people thinking about longer-term solutions.
    
    ^ permalink raw reply	[flat|nested] 23+ messages in thread

    end of thread, other threads:[~2005-04-27  8:10 UTC | newest]
    
    Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <425C3F12.9070606@zytor.com>
         [not found] ` <Pine.LNX.4.58.0504121452330.4501@ppc970.osdl.org>
         [not found]   ` <20050412224027.GB20821@elte.hu>
         [not found]     ` <Pine.LNX.4.58.0504121554140.4501@ppc970.osdl.org>
         [not found]       ` <20050412230027.GA21759@elte.hu>
         [not found]         ` <20050412230729.GA22179@elte.hu>
         [not found]           ` <20050413111355.GB13865@elte.hu>
         [not found]             ` <425D4E1D.4040108@zytor.com>
         [not found]               ` <20050413165310.GA22428@elte.hu>
         [not found]                 ` <425D4FB1.9040207@zytor.com>
         [not found]                   ` <20050413171052.GA22711@elte.hu>
         [not found]                     ` <Pine.LNX.4.58.0504131027210.4501@ppc970.osdl.org>
         [not found]                       ` <20050413182909.GA25221@elte.hu>
         [not found]                         ` <Pine.LNX.4.58.0504131144160.4501@ppc970.osdl.org>
    2005-04-13 20:02                           ` Index/hash order Ingo Molnar
    2005-04-13 20:07                             ` H. Peter Anvin
    2005-04-13 20:15                               ` Ingo Molnar
    2005-04-13 20:18                                 ` Ingo Molnar
    2005-04-13 20:21                                   ` Ingo Molnar
    2005-04-13 20:26                                     ` Updated base64 patches H. Peter Anvin
    2005-04-13 21:04                                 ` Index/hash order Linus Torvalds
    2005-04-20  7:40                                   ` enforcing DB immutability Ingo Molnar
    2005-04-20  7:49                                     ` Ingo Molnar
    2005-04-20  7:53                                       ` Ingo Molnar
    2005-04-20  8:58                                         ` Chris Wedgwood
    2005-04-20 14:57                                       ` Nick Craig-Wood
    2005-04-27  8:15                                       ` Wout
    2005-04-13 20:15                               ` Index/hash order Linus Torvalds
    2005-04-13 20:28                         ` Baruch Even
         [not found]                   ` <Pine.LNX.4.58.0504131008500.4501@ppc970.osdl.org>
    2005-04-13 21:40                     ` Florian Weimer
    2005-04-13 22:11                       ` Linus Torvalds
    2005-04-13 22:48                         ` Florian Weimer
    2005-04-14  7:04                         ` Ingo Molnar
    2005-04-14 10:50                           ` cache-cold repository performance Ingo Molnar
    2005-04-20  8:41 enforcing DB immutability linux
    2005-04-20 15:57 ` Erik Mouw
    2005-04-22 16:10 ` Bill Davidsen
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox;
    as well as URLs for NNTP newsgroup(s).