linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Johannes Thumshirn <jth@kernel.org>,
	Naohiro Aota <Naohiro.Aota@wdc.com>,
	Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH v3 1/2] fs: New zonefs file system
Date: Thu, 2 Jan 2020 13:36:12 -0800	[thread overview]
Message-ID: <20200102213612.GD1508633@magnolia> (raw)
In-Reply-To: <BYAPR04MB58160982BF645C23505BA085E7280@BYAPR04MB5816.namprd04.prod.outlook.com>

On Wed, Dec 25, 2019 at 08:21:58AM +0000, Damien Le Moal wrote:
> On 2019/12/25 16:20, Damien Le Moal wrote:
> > 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.
> 
> Retracting this... My apologies for the noise.
> 
> Checkpatch does complain about the use of symbolic permissions:
> 
> WARNING: Symbolic permissions 'S_IRWXUGO' are not preferred. Consider
> using octal permissions '0777'.
> #657: FILE: fs/zonefs/super.c:400:
> +               inode->i_mode &= ~S_IRWXUGO;
> 
> I do not understand why this would be a problem. I still went ahead and
> used the macros as I find the code more readable using them. Please let
> me know if that is not recommended (checking the code, not surprisingly,
> many FS use these macros).

/me shrugs, I guess we're not supposed to use S_* in code.  Sorry about
the unnecessary churn. :/

--D

> > 
> >>
> >>>
> >>> 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

  reply	other threads:[~2020-01-02 21:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-24  2:06 [PATCH v3 0/2] New zonefs file system Damien Le Moal
2019-12-24  2:06 ` [PATCH v3 1/2] fs: " Damien Le Moal
2019-12-24  4:40   ` Darrick J. Wong
2019-12-25  6:05     ` Damien Le Moal
2019-12-25  7:20       ` Damien Le Moal
2019-12-25  8:21         ` Damien Le Moal
2020-01-02 21:36           ` Darrick J. Wong [this message]
2020-01-03  0:08             ` Linus Torvalds
2019-12-24  2:06 ` [PATCH v3 2/2] zonefs: Add documentation Damien Le Moal
2019-12-25  1:33   ` Randy Dunlap
2019-12-25  2:57     ` Damien Le Moal
2019-12-25  6:40     ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200102213612.GD1508633@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=Naohiro.Aota@wdc.com \
    --cc=hare@suse.de \
    --cc=jth@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).