All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Tyler Hicks <tyhicks@canonical.com>
Cc: Tom Marshall <tom@cyngn.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [RFC] Per-file compression
Date: Mon, 20 Apr 2015 18:51:03 +0200	[thread overview]
Message-ID: <55352E77.4080100@nod.at> (raw)
In-Reply-To: <20150420145357.GA10981@boyd>

Am 20.04.2015 um 16:53 schrieb Tyler Hicks:
> On 2015-04-18 17:07:16, Richard Weinberger wrote:
>> Hi!
>>
>> Am 18.04.2015 um 16:58 schrieb Tom Marshall:
>>> On Sat, Apr 18, 2015 at 01:41:09PM +0200, Richard Weinberger wrote:
>>>> On Sat, Apr 18, 2015 at 12:20 AM, Tom Marshall <tom@cyngn.com> wrote:
>>>>> So, I wrote a thing called 'zfile' that hooks into the VFS layer and
>>>>> intercepts file_operations to do file (de)compression on the fly. When a
>>>>> file is opened, it reads and decompresses the data into memory.  The file
>>>>> may be read, written, and mmaped in the usual way.  If the contents are
>>>>> changed, the data is compressed and written back.  A working patch for an
>>>>> older kernel version may be found at:
>>>>> http://review.cyanogenmod.org/#/c/95220/
>>>>
>>>> So, I've extracted the patch from that website and gave a quick review.
>>>>
>>>> I'm pretty sure VFS folks will hate the VFS layering you do.
>>>
>>> This, I'm afraid, is the biggest obstacle to such a solution.  I know that
>>> OverlayFS has been merged, so filesystem stacking is acceptable.  Perhaps
>>> there would be a way to design a filesystem that stacks compression?
>>
>> That's why I said think of adding compression support to ecryptfs.
> 
> I think adding compression support to eCryptfs is the wrong approach.
> The "X is already a stacked filesystem so look into adding compression
> support to it" logic also works when X=overlayfs. I doubt that Miklos
> would be willing to accept such a feature. :)

My thought was that compression is not far away from crypto an hence
a lot of ecryptfs could be reused.

> A stacked filesystem that implements compression should be fairly
> simple. If it is not simple, it is too complicated to try to wedge into
> an unrelated stacked filesystem.
> 
> While it may be the quickest route to your end goal, it will overly
> complicate eCryptfs. eCryptfs already has plenty of complexity around
> the file offset since metadata may be stored in the first 8192 bytes of
> the lower file, which offsets the entire file, and the end of the file
> has to be padded. Mixing in compression would make things much worse.

I assumed that you need also some meta data for compression.
At least if you do it in a non-trivial way.

> Also, eCryptfs has lots of cruft that is definitely not needed for
> compression.

As you're the maintainer of ecryptfs you know obviously better than I do. :)
Tom, to make the story short, you'll have to experiment a bit.

Thanks,
//richard

  reply	other threads:[~2015-04-20 16:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 22:20 [RFC] Per-file compression Tom Marshall
2015-04-18  8:06 ` Richard Weinberger
2015-04-18 23:09   ` Theodore Ts'o
2015-04-20  3:00     ` Alex Elsayed
2015-04-18 11:41 ` Richard Weinberger
2015-04-18 14:58   ` Tom Marshall
2015-04-18 15:07     ` Richard Weinberger
2015-04-18 15:48       ` Tom Marshall
2015-04-18 15:52         ` Richard Weinberger
2015-04-20 14:53       ` Tyler Hicks
2015-04-20 16:51         ` Richard Weinberger [this message]
2015-04-21 15:18           ` Theodore Ts'o
2015-04-21 15:37             ` Jeff Moyer
2015-04-21 16:54               ` Theodore Ts'o
2015-04-29 23:15             ` Tom Marshall
2015-05-01 18:09 ` Steve French
  -- strict thread matches above, loose matches on Subject: below --
2015-04-19 21:15 Tom Marshall
2015-04-21  3:29 Tom Marshall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55352E77.4080100@nod.at \
    --to=richard@nod.at \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tom@cyngn.com \
    --cc=tyhicks@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.