linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH v2] quota: widen timestamps for the fs_disk_quota structure
Date: Sun, 6 Sep 2020 10:09:57 -0700	[thread overview]
Message-ID: <20200906170957.GE7955@magnolia> (raw)
In-Reply-To: <20200905220231.GB16750@casper.infradead.org>

On Sat, Sep 05, 2020 at 11:02:31PM +0100, Matthew Wilcox wrote:
> On Sat, Sep 05, 2020 at 09:47:03AM -0700, Darrick J. Wong wrote:
> > +static inline void copy_to_xfs_dqblk_ts(const struct fs_disk_quota *d,
> > +		__s32 *timer_lo, __s8 *timer_hi, s64 timer)
> > +{
> > +	*timer_lo = timer;
> > +	if (d->d_fieldmask & FS_DQ_BIGTIME)
> > +		*timer_hi = timer >> 32;
> > +	else
> > +		*timer_hi = 0;
> > +}
> 
> Is that actually the right thing to do?  If FS_DQ_BIGTIME is not set,
> I would expect us to avoid writing to timer_hi at all.  Alternatively, if
> we do want to write to timer_hi, why not write to it unconditionally?

If the flag isn't set, then the space used by timer_hi is a zero-filled
padding field.  Therefore, I made this function zero timer_hi if the
bigtime flag isn't set.  It's redundant with the memset five lines up
from the call site, but I don't like leaving logic bombs in case this
function ever gets exported elsewhere.

--D

  reply	other threads:[~2020-09-06 17:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05 16:47 [PATCH v2] quota: widen timestamps for the fs_disk_quota structure Darrick J. Wong
2020-09-05 16:50 ` [PATCH] quotatools: support grace period expirations past y2038 in userspace Darrick J. Wong
2020-09-07 10:22   ` Jan Kara
2020-09-05 22:02 ` [PATCH v2] quota: widen timestamps for the fs_disk_quota structure Matthew Wilcox
2020-09-06 17:09   ` Darrick J. Wong [this message]
2020-09-07 10:02 ` Jan Kara
2020-09-07 15:01   ` Darrick J. Wong
2020-09-07 16:28     ` Jan Kara
2020-09-08 14:33 ` Christoph Hellwig
2020-09-09  1:33 ` Darrick J. Wong

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=20200906170957.GE7955@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=willy@infradead.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).