Re: [PATCH v2 1/2] common/rc: Check 'tPnE' flags on a directory instead of a regilar file

Xiao Yang
2020-09-17T04:05:55Z

On 2020/9/14 15:26, Christoph Hellwig wrote:
> On Mon, Sep 14, 2020 at 01:13:59PM +0800, Xiao Yang wrote:
>> 'tPnE' flags are only valid for a directory so check them on a directory.
>>
>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> The change looks good, but I wonder if we should split the chattr
> tests into
>
> _require_chattr_file_flag
>
> and
>
> _require_chattr_dir_flag
>
> to make the whole thing a little less convoluted..
Hi Christoph,

Sorry for the late reply.

It seems hard to factor out _require_chattr_file_flag() and
_require_chattr_dir_flag()
because we need to get attribute after running chattr command and then check
attribute after parsing all stderr of chattr command.
Could you provide me some detailed guide? Thanks a lot :-)

Best Regards,
Xiao Yang
>
>
> .
>