[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR04MB58167AD3E7519632746CDE72E7280@BYAPR04MB5816.namprd04.prod.outlook.com>
Date: Wed, 25 Dec 2019 07:20:02 +0000
From: Damien Le Moal <Damien.LeMoal@....com>
To: "Darrick J. Wong" <darrick.wong@...cle.com>
CC: "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Johannes Thumshirn <jth@...nel.org>,
Naohiro Aota <Naohiro.Aota@....com>,
Hannes Reinecke <hare@...e.de>
Subject: Re: [PATCH v3 1/2] fs: New zonefs file system
On 2019/12/25 15:05, Damien Le Moal wrote:
>>> + inode->i_mode = S_IFREG;
>>
>> i_mode &= ~S_IRWXUGO; ?
>
> Yes, indeed that is better. checkpatch.pl does spit out a warning if one
> uses the S_Ixxx macros though. See below.
Please disregard this comment. checkpatch is fine. For some reasons I
had warnings in the past but they are now gone. So using the macros
instead of the harder to read hard-coded values.
>
>>
>> Note that clearing the mode flags won't prevent programs with an
>> existing writable fd from being able to call write(). I'd imagine that
>> they'd hit EIO pretty fast though, so that might not matter.
>>
>>> + zone->wp = zone->start;
>>> + } else if (zone->cond == BLK_ZONE_COND_READONLY) {
>>> + inode->i_flags |= S_IMMUTABLE;
>>> + inode->i_mode &= ~(0222); /* S_IWUGO */
>>
>> Might as well just use S_IWUGO directly here?
Yes, I did in v4.
> Because checkpatch spits out a warning if I do. I would prefer using the
> macro as I find it much easier to read. Should I just ignore checkpatch
> warning ?
My mistake. No warnings :)
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists