Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2098733pxu; Sat, 17 Oct 2020 11:27:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYBi4fJlx8SMMR5YzfCeCqogWS6x5y3Hhp1zTsgqw6EGYwmTDkWt0PWUDDEiu2C/KSChv8 X-Received: by 2002:a50:c349:: with SMTP id q9mr10440469edb.125.1602959257680; Sat, 17 Oct 2020 11:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602959257; cv=none; d=google.com; s=arc-20160816; b=BjwLYGlQcaxHc/WE32j65LLTjab8YQDpLqS5Fy8JqdQDQHyPecqVa7kz50mRbmwiiY 0ZEQWskmOVvfsv0W35yYgioeD5kSIw/ildDiAWIzj/15Qn6DmxGRKNd3O+wprHBdMmGQ HlvByEyt9Au6HbVTf/UWWqYFTZIv62zNhscvexrdSYODXANjvNY6MxerTGMMoORKL/NB phbqjWwogADXXBZXxqC6SSP32TOKB8dmjHNcYN8bKMgW0uLmAi8J5LOXyhofyJoWQ+DY PASqwfy1liyyudzN7GcPeowJi9DNl89t330Cptt2wic/F/cynYauIhUE7BI7+p62pSZy 2jFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=QDkrewxCUIAVycFdaQJbt/qcXN6h537xEA8z/cZ74Qw=; b=pjXflA+hZ+cM3te/D/I1PKABE4CM59N5P02uy50EKdft7BNLmj1GT7irzRVlyOhoAl Tx9nu+rl/lh+QSEK+d6y66acS+h366HBefbnf6x54Fj+bK2M2qXN5P7n8iurR2qZILTR 51hhQAK2H64kFn+Z/9KvdzCYakvcKuazpcCGdlnooGCyZ0gypB/U1c8/zmEsk4OK2lq/ Rupp8NhrxP8StnzxCcIsigmVx6twTRv9cCUmSJ/HlwhOa5u6vbXoTHT8y/DcXIb/NPMK 54WSKLtu3GEf5ATAomTrpYwoWWhlz7aoGw7SYAnDss57SU8gnGXGSMK26s5SrNfIR+1d cE8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=bKdO243H; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si4145214ejy.232.2020.10.17.11.26.59; Sat, 17 Oct 2020 11:27:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=bKdO243H; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437369AbgJQS06 (ORCPT + 99 others); Sat, 17 Oct 2020 14:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436970AbgJQS06 (ORCPT ); Sat, 17 Oct 2020 14:26:58 -0400 Received: from forwardcorp1p.mail.yandex.net (forwardcorp1p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b6:217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDE47C061755 for ; Sat, 17 Oct 2020 11:26:54 -0700 (PDT) Received: from myt5-23f0be3aa648.qloud-c.yandex.net (myt5-23f0be3aa648.qloud-c.yandex.net [IPv6:2a02:6b8:c12:3e29:0:640:23f0:be3a]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id A5E032E1456; Sat, 17 Oct 2020 21:26:38 +0300 (MSK) Received: from myt4-18a966dbd9be.qloud-c.yandex.net (myt4-18a966dbd9be.qloud-c.yandex.net [2a02:6b8:c00:12ad:0:640:18a9:66db]) by myt5-23f0be3aa648.qloud-c.yandex.net (mxbackcorp/Yandex) with ESMTP id MBw1bwNhIW-Qcw4tCEV; Sat, 17 Oct 2020 21:26:38 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1602959198; bh=QDkrewxCUIAVycFdaQJbt/qcXN6h537xEA8z/cZ74Qw=; h=Message-ID:In-Reply-To:Subject:To:From:References:Date:cc; b=bKdO243HqRArZr6CzsyLD5W9l5n7wVqIPBIvgaSDIP4Q+A6HJhOIK/XugrH32lQ+g ABbYo+HJGPAok54nqPNOwqKVWQX6LVFqmZNsp20zW6RllwlbvXdvZ4zD7tpG648VPl 178trz9o0JMp28Hiu/6/B7pGbAQMNzZcDwccC2SQ= Authentication-Results: myt5-23f0be3aa648.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-vpn.dhcp.yndx.net (dynamic-vpn.dhcp.yndx.net [2a02:6b8:b080:6602::1:2]) by myt4-18a966dbd9be.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id zyPwW8ZZmN-QcnmTOxa; Sat, 17 Oct 2020 21:26:38 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Date: Sat, 17 Oct 2020 21:26:37 +0300 (MSK) From: Roman Anufriev X-X-Sender: dotdot@dotdot-osx To: Jan Kara cc: linux-ext4@vger.kernel.org, tytso@mit.edu, dmtrmonakhov@yandex-team.ru Subject: Re: [PATCH 2/2] ext4: export quota journalling mode via sysfs attr quota_mode In-Reply-To: <20201015131522.GF7037@quack2.suse.cz> Message-ID: References: <1602761572-4713-1-git-send-email-dotdot@yandex-team.ru> <1602761572-4713-2-git-send-email-dotdot@yandex-team.ru> <20201015131522.GF7037@quack2.suse.cz> User-Agent: Alpine 2.23 (OSX 453 2020-06-18) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi, sorry for the delay. On Thu, 15 Oct 2020, Jan Kara wrote: > On Thu 15-10-20 14:32:52, Roman Anufriev wrote: >> Right now, it is hard to understand what quota journalling type is enabled: >> you need to be quite familiar with kernel code and trace it or really >> understand what different combinations of fs flags/mount options lead to. >> >> This patch exports via sysfs attr /sys/fs/ext4//quota_mode current >> quota jounalling mode, making it easier to check at a glance/in autotests. >> The semantics is similar to ext4 data journalling modes: >> >> * journalled - quota accounting and journaling are enabled >> * writeback - quota accounting is enabled, but journalling is disabled >> * none - quota accounting is disabled >> * disabled - kernel compiled without CONFIG_QUOTA feature >> >> Signed-off-by: Roman Anufriev >> Reviewed-by: Dmitry Monakhov > > Hum, I'm not sure about this. The state of quota can be found out with > "quotaon -p " (or corresponding quotactl if you need this from > C). The only thing you won't learn is journalled / writeback mode and > generally you should not care about this although I agree that for fs > crash testing purposes you may care. But is that big enough usecase for a > new sysfs file when all the information is already available for userspace > just not in a convenient form? Rationale behind this patch was mainly the addition of an easy way to check whether quota journalled or not as this is quite wanted feature in out production environment. TBH, I was not sure about sysfs file too, but it seemed to me like the most natural place to put it. Maybe if sysfs is an overkill - just add printing to dmesg on mount? At least, you'll be able to check what quota type you can enable right after mounting. > BTW, I've now realized ext4_any_quota_enabled() has actually misleading > name in the sysfs file reports wrong information. It is rather > ext4_any_quota_may_be_enabled() since presence of QUOTA mount option only > says that quotaon(8) will enable quotas if it is run, not that quota > accounting is enabled. sb_any_quota_loaded() tells you if accounting is > actually enabled or not (however this can change anytime so that's why we > use more relaxed checks for the purpose of journal credit estimates). My bad! Totally forgot about the case when 'quota' mount option is present but quota accounting is not enabled, as our helper-tool around 'quotactl()' do remounting+enabling in one go. I'll rename the function to smth like 'ext4_quota_capable()' in v2. And if printing to dmesg is OK, I'll probably still use this function to print on mount what the quota type will be after accounting is enabled. Roman