From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753798AbdFSJDe (ORCPT ); Mon, 19 Jun 2017 05:03:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:49246 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753492AbdFSJDc (ORCPT ); Mon, 19 Jun 2017 05:03:32 -0400 Date: Mon, 19 Jun 2017 11:03:29 +0200 From: Jan Kara To: Tahsin Erdogan Cc: Jan Kara , Jan Kara , "Theodore Ts'o" , Andreas Dilger , Dave Kleikamp , Alexander Viro , Mark Fasheh , Joel Becker , Jens Axboe , Deepa Dinamani , Mike Christie , Fabian Frederick , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org Subject: Re: [PATCH 28/28] quota: add extra inode count to dquot transfer functions Message-ID: <20170619090329.GE11837@quack2.suse.cz> References: <20170531081517.11438-1-tahsin@google.com> <20170531081517.11438-28-tahsin@google.com> <20170615075735.GB1764@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 16-06-17 18:50:58, Tahsin Erdogan wrote: > On Thu, Jun 15, 2017 at 12:57 AM, Jan Kara wrote: > > Hum, rather handle this similarly to how we handle delalloc reserved space. > > Add a callback to dq_ops to get "inode usage" of an inode and then use it > > in dquot_transfer(), dquot_free_inode(), dquot_alloc_inode(). > > I tried that approach by adding a "int get_inode_usage(struct inode > *inode, qsize_t *usage)" callback to dquot_operations. Unfortunately, > ext4 code that calculates the number of internal inodes > (ext4_xattr_inode_count()) is subject to failures so the callback has > to be able to report errors. And, that itself is problematic because > we can't afford to have errors in dquot_free_inode(). If you have > thoughts about how to address this please let me know. Well, you can just make dquot_free_inode() return error. Now most callers won't be able to do much with an error from dquot_free_inode() but that's the case also for other things during inode deletion - just handle it as other fatal failures during inode freeing. > Alternatively, I could try to make this patch less intrusive by > keeping the existing dquot_transfer() signature and add a new > dquot_transfer_usage() that accepts inode_usage as a parameter. What > do you think? That would be somewhat better than what you do in this patch but I prefer to handle this like I suggested above. Honza -- Jan Kara SUSE Labs, CR From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Date: Mon, 19 Jun 2017 11:03:29 +0200 Subject: [Ocfs2-devel] [PATCH 28/28] quota: add extra inode count to dquot transfer functions In-Reply-To: References: <20170531081517.11438-1-tahsin@google.com> <20170531081517.11438-28-tahsin@google.com> <20170615075735.GB1764@quack2.suse.cz> Message-ID: <20170619090329.GE11837@quack2.suse.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tahsin Erdogan Cc: Jan Kara , Jan Kara , Theodore Ts'o , Andreas Dilger , Dave Kleikamp , Alexander Viro , Mark Fasheh , Joel Becker , Jens Axboe , Deepa Dinamani , Mike Christie , Fabian Frederick , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org On Fri 16-06-17 18:50:58, Tahsin Erdogan wrote: > On Thu, Jun 15, 2017 at 12:57 AM, Jan Kara wrote: > > Hum, rather handle this similarly to how we handle delalloc reserved space. > > Add a callback to dq_ops to get "inode usage" of an inode and then use it > > in dquot_transfer(), dquot_free_inode(), dquot_alloc_inode(). > > I tried that approach by adding a "int get_inode_usage(struct inode > *inode, qsize_t *usage)" callback to dquot_operations. Unfortunately, > ext4 code that calculates the number of internal inodes > (ext4_xattr_inode_count()) is subject to failures so the callback has > to be able to report errors. And, that itself is problematic because > we can't afford to have errors in dquot_free_inode(). If you have > thoughts about how to address this please let me know. Well, you can just make dquot_free_inode() return error. Now most callers won't be able to do much with an error from dquot_free_inode() but that's the case also for other things during inode deletion - just handle it as other fatal failures during inode freeing. > Alternatively, I could try to make this patch less intrusive by > keeping the existing dquot_transfer() signature and add a new > dquot_transfer_usage() that accepts inode_usage as a parameter. What > do you think? That would be somewhat better than what you do in this patch but I prefer to handle this like I suggested above. Honza -- Jan Kara SUSE Labs, CR