Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042AbdGIBCa (ORCPT ); Sat, 8 Jul 2017 21:02:30 -0400 Received: from imap.thunk.org ([74.207.234.97]:59974 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751021AbdGIBC2 (ORCPT ); Sat, 8 Jul 2017 21:02:28 -0400 Date: Sat, 8 Jul 2017 21:01:55 -0400 From: "Theodore Ts'o" To: Linus Torvalds Cc: Andreas Dilger , David Howells , Christoph Hellwig , Alexander Viro , linux-fsdevel , Linux API , linux-afs@lists.infradead.org, Linux Kernel Mailing List Subject: Re: [PATCH 2/2] afs: Add metadata xattrs Message-ID: <20170709010155.3nql5ixdeozemgfd@thunk.org> Mail-Followup-To: Theodore Ts'o , Linus Torvalds , Andreas Dilger , David Howells , Christoph Hellwig , Alexander Viro , linux-fsdevel , Linux API , linux-afs@lists.infradead.org, Linux Kernel Mailing List References: <20170706152304.GA10584@infradead.org> <149935261019.29744.8564287571048506851.stgit@warthog.procyon.org.uk> <149935262759.29744.6299062653432480230.stgit@warthog.procyon.org.uk> <31934.1499357651@warthog.procyon.org.uk> <2863583A-79F1-4998-8AC4-1C4C9D4C060F@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170306 (1.8.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: 1307 Lines: 27 On Sat, Jul 08, 2017 at 12:44:54PM -0700, Linus Torvalds wrote: > Yeah, I think attributes are likely much better than some random crazy > ioctl interface. They can be listed with generic tools, and have > various scripting interfaces in ways that ioctl's do not sanely have. I personally don't have a particular problem with these xattrs. For one thing, they are read-only. You use them just to find out the AFS cell, the AFS "fid", and the AFS volume name. I think the place where people will start getting nervous is when we start adding "write-only" xattrs or where writing to an xattr causes a side-effect to take place. So using xattr's to set AFS quota's for a volume, or to tell a client about a new AFS cell, or to tell the client kernel about the database servers for an AFS cell --- that I think would be pretty ugly. Since such API's affect global state, and not a per-file state, I don't believe xattrs are a good substitute for everything that was done with the AFS pioctl system call for other operating systems. For those uses cases my personal opinion is that defining new Linux system calls for such things would make a lot more sense. Or maybe just use sysfs interfaces for such things, although that has gotten abused in the past too.... - Ted