From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754044AbdFSLqL (ORCPT ); Mon, 19 Jun 2017 07:46:11 -0400 Received: from mail-yw0-f172.google.com ([209.85.161.172]:34815 "EHLO mail-yw0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753905AbdFSLqC (ORCPT ); Mon, 19 Jun 2017 07:46:02 -0400 MIME-Version: 1.0 In-Reply-To: <20170619090329.GE11837@quack2.suse.cz> References: <20170531081517.11438-1-tahsin@google.com> <20170531081517.11438-28-tahsin@google.com> <20170615075735.GB1764@quack2.suse.cz> <20170619090329.GE11837@quack2.suse.cz> From: Tahsin Erdogan Date: Mon, 19 Jun 2017 04:46:00 -0700 Message-ID: Subject: Re: [PATCH 28/28] quota: add extra inode count to dquot transfer functions To: Jan Kara Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> 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. > I just checked dquot_free_inode() to see whether it calls anything that could fail. It calls mark_all_dquot_dirty() and ignores the return code from it. I would like to follow the same for the get_inode_usage() as the only use case for get_inode_usage() (ext4) should not fail at inode free time. Basically, I want to avoid changing return type from void to int because it would create a new responsibility for the filesystem implementations who do not know how to deal with it.