Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752632AbcKRIrN (ORCPT ); Fri, 18 Nov 2016 03:47:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48728 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbcKRIrK (ORCPT ); Fri, 18 Nov 2016 03:47:10 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <72C23B81-F59F-458E-B9B1-87A84CF9D6D4@dilger.ca> References: <72C23B81-F59F-458E-B9B1-87A84CF9D6D4@dilger.ca> <147938969703.13574.10295364502230379833.stgit@warthog.procyon.org.uk> <147938972442.13574.1819690786475800772.stgit@warthog.procyon.org.uk> To: Andreas Dilger Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] statx: AFS: Return enhanced file attributes MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25342.1479458828.1@warthog.procyon.org.uk> Date: Fri, 18 Nov 2016 08:47:08 +0000 Message-ID: <25343.1479458828@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 18 Nov 2016 08:47:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 912 Lines: 22 Andreas Dilger wrote: > > STATX_ATIME, STATX_CTIME and STATX_BLOCKS are cleared as AFS does not > > support them. > > Rather than clearing specific flags, wouldn't it be better to explicitly > set the flags that are actually being returned? Otherwise, this would > have the problem that Dave pointed out on the 0/4 patch, that there may > be flags still set from userspace that do not mean anything to AFS. I'm not sure it make a difference. generic_fillattr() has to initialise result_mask to STATX_BASIC_STATS for the support of any unmodified filesystem. We can then either clear the bits we don't want or just overwrite the mask entirely with the bits we do want. Bits in request_mask that are beyond STATX_BASIC_STATS are not automatically propagated to result_mask. Possibly vfs_xgetattr_nosec() should preset the result_mask rather than doing this in generic_fillattr(). David