lkml.org 
[lkml]   [2019]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 1/2] fs: New zonefs file system
Date
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

\
 
 \ /
  Last update: 2019-12-25 08:21    [W:0.055 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site