From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319AbdJWKLn (ORCPT ); Mon, 23 Oct 2017 06:11:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:41884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbdJWKLl (ORCPT ); Mon, 23 Oct 2017 06:11:41 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E2442190B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=chao@kernel.org Subject: Re: [f2fs-dev] [PATCH] f2fs: expose some sectors to user in inline data or dentry case To: Jaegeuk Kim , Chao Yu Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <20171013173145.36510-1-jaegeuk@kernel.org> <6ecc1778-bcf8-c07d-037a-dd733e247fa9@huawei.com> <20171017220327.GA20428@jaegeuk-macbookpro.roam.corp.google.com> <4e39c0c5-2cfb-5dd5-4c29-5bff7b2373f8@huawei.com> <20171019191229.GC82186@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: Date: Mon, 23 Oct 2017 18:11:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171019191229.GC82186@jaegeuk-macbookpro.roam.corp.google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/10/20 3:12, Jaegeuk Kim wrote: > On 10/18, Chao Yu wrote: >> On 2017/10/18 6:03, Jaegeuk Kim wrote: >>> On 10/16, Chao Yu wrote: >>>> On 2017/10/14 1:31, Jaegeuk Kim wrote: >>>>> If there's some data written through inline data or dentry, we need to shouw >>>>> st_blocks. This fixes reporting zero blocks even though there is small written >>>>> data. >>>>> >>>>> Signed-off-by: Jaegeuk Kim >>>> >>>> Reviewed-by: Chao Yu >>>> >>>> Thanks, >>>> >>>>> --- >>>>> fs/f2fs/file.c | 5 +++++ >>>>> 1 file changed, 5 insertions(+) >>>>> >>>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c >>>>> index 2eb3efe92018..f7be6c394fa8 100644 >>>>> --- a/fs/f2fs/file.c >>>>> +++ b/fs/f2fs/file.c >>>>> @@ -698,6 +698,11 @@ int f2fs_getattr(const struct path *path, struct kstat *stat, >>>>> STATX_ATTR_NODUMP); >>>>> >>>>> generic_fillattr(inode, stat); >>>>> + >>>>> + /* we need to show initial sectors used for inline_data/dentries */ >>>>> + if (f2fs_has_inline_data(inode) || f2fs_has_inline_dentry(inode)) >>> >>> FYI; >>> I added S_ISREG(inode->i_mode) with f2fs_has_inline_data() to avoid quotacheck >>> error. >> >> If this patch is related to quotacheck issue, I doubt that there will be >> problemetic, in no journalled quota case, fs quota system won't stat blocks >> in inline file, however, after SPO, when using quotacheck to scan file to >> recover quota info, blocks of inline file showed in getattr can be stated >> into quota. That would be inconsistent. > > FWIW, quotacheck counts i_blocks via ioctl for normal files. Without this > modification, xfstests gives an failure on quota cases. OK, let's fix this issue first. ;) Thanks, > >> >> Thanks, >> >>> >>>>> + stat->blocks += (stat->size + 511) >> 9; >>>>> + >>>>> return 0; >>>>> } >>>>> >>>>> >>> >>> . >>> > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel >