Comment 3 for bug 911507

Revision history for this message
Tyler Hicks (tyhicks) wrote : Re: [Bug 911507] Re: eCryptfs should initialize existing empty files at open()

On 2012-01-04 08:30:57, Mikko Rantalainen wrote:
> eCryptfs should have an fsck which could remove such empty files from
> lower filesystem or convert those files to encrypted empty files.
> However, I don't think that filesystem should automatically do such a
> tricks. (Compare to existing filesystems such as ext4 - it does not
> automatically try to run fsck and fix logical problems in the
> filesystem.)

Thanks for your thoughts/feedback on this issue.

Keep in mind that we already do this in the ->create() function. This
would be an extension of that where if we didn't see the metadata in our
->open() function and the lower inode size is 0, we'd generate new
metadata and write it out.

> I'd prefer a single error message to syslog about the problem and then
> automatically remounting ecryptfs read-only. Then I would have to run
> fsck to fix the issue. Hopefully the syslog entry would point me towards
> that target.

I'd prefer no error messages to syslog (filesystems really shouldn't be
so chatty) and for things to be handled transparently for the user.

Remounting read-only is definitely not an option. Too many users are
starting to hit this issue and remounting read-only would be a usability
nightmare. It makes sense for power users and admins, but non-advanced
users would have a lot of trouble figuring out how to mediate the issue.

What if this functionality was only enabled when a mount option is
specified? By default, eCryptfs would continue with its stubborn ways of
erroring out on empty lower files, but a mount option would be available
to allow them to be converted to proper eCryptfs format in ->open(). Any
thoughts?