Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936138AbcJUWe6 (ORCPT ); Fri, 21 Oct 2016 18:34:58 -0400 Received: from imap.thunk.org ([74.207.234.97]:59246 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933575AbcJUWez (ORCPT ); Fri, 21 Oct 2016 18:34:55 -0400 Date: Fri, 21 Oct 2016 18:34:25 -0400 From: "Theodore Ts'o" To: Eric Biggers Cc: Michael Halcrow , Richard Weinberger , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, dedekind1@gmail.com, adrian.hunter@intel.com, jaegeuk@kernel.org, david@sigma-star.at, wd@denx.de, sbabic@denx.de, dengler@linutronix.de, alexcope@google.com Subject: Re: [PATCH 26/26] ubifs: Raise write version to 5 Message-ID: <20161021223425.sqtjey2xov7fqjh3@thunk.org> Mail-Followup-To: Theodore Ts'o , Eric Biggers , Michael Halcrow , Richard Weinberger , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, dedekind1@gmail.com, adrian.hunter@intel.com, jaegeuk@kernel.org, david@sigma-star.at, wd@denx.de, sbabic@denx.de, dengler@linutronix.de, alexcope@google.com References: <1477054121-10198-1-git-send-email-richard@nod.at> <1477054121-10198-27-git-send-email-richard@nod.at> <20161021173154.GB17121@google.com> <20161021174758.wz7xrulokicuhlht@thunk.org> <20161021181931.GA90712@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161021181931.GA90712@google.com> User-Agent: NeoMutt/20160916 (1.7.0) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2491 Lines: 47 On Fri, Oct 21, 2016 at 11:19:31AM -0700, Eric Biggers wrote: > > I don't think it's reasonable to require require changes to filesystems whenever > someone introduces a new encryption mode --- contents, filenames, or both. > Filesystems need to be able to handle unsupported encryption modes in some way > that makes sense. Currently, when it sees an unsupported encryption mode > fscrypto will behave as if the encryption key is not available and will also > print a one-time warning to the kernel log. This happens when a file is > accessed, not when the filesystem is mounted. As far as I can tell, ext4, f2fs, > and ubifs would all behave this way because this code is shared. I think this > is probably the most realistic behavior. I tend to agree, but file systems may choose some alternate approach if they want to "fail fast" (e.g., at mount time). I wouldn't want to do that for ext4, but if ubifs (or some other file system) wants do something more draconian, they can be afraid to do that. Failing that, some kind of one-time warning makes sense. What I would like to do though is to is to have a callback so that code in fs/crypto can call a file system specific notification routine. e.g., for ext4, we would probably want to be able to call ext4_warning() and ext4_error() from fs/crypto, and other file systems might want to have a different set of notification routines. This way we can print a message like kernel: EXT4-fs warning (device sdb1): fscrypto_xxx: foo bar baz and if we later on have a way of sending file system specific warnings or errors through some kind of IPC mechanism, such as netlink or some future kdbus scheme, we can send the warning and error messages out the same way we send other filesystem specific error messages. - Ted P.S. BTW, we actually _do_ have something hacked together inside the Google production kernel which pipes ext4_error() messages to a netlink socket, so that monitoring systems don't have scrape dmesg or /var/log/messages. If anyone inside or outside google is interested in that functionality, I can make the code available. There's nothing sensitive or Google specific in it; it's just that unfortunately, getting that code cleaned up and upstreamed has just never made it "above the fold" on the priority list, the engineer who originally implemented it is no longer on the team --- and I never had the time to cleanup work to get the code to upstream quality myself.