All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 02/11] xfs: create the XFS_QMOPT_QUOTIP_LOCKED flag
Date: Sat, 21 Apr 2018 11:42:51 -0700	[thread overview]
Message-ID: <20180421184251.GA26268@magnolia> (raw)
In-Reply-To: <20180419083224.GA17515@infradead.org>

On Thu, Apr 19, 2018 at 01:32:24AM -0700, Christoph Hellwig wrote:
> On Tue, Apr 17, 2018 at 07:39:39PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Create a new QMOPT flag to signal that we've already locked the quota
> > inode.  This will be used by the quota scrub code refactoring to avoid
> > dropping the quota ip lock during scrub.  The flag is incompatible with
> > the DQALLOC flag because dquot allocation creates a transaction, and we
> > shouldn't be doing that with the ILOCK held.
> 
> Locked flag are always a sign for code smell.  And this already is
> pretty smelly code before that flag is added.  I think someone (i.e.
> either you or me :)) needs to do a major refactoring here first.

Bleh... ok, I marched through that swamp and refactored all that goopy
dqget crud into a ton of smaller helper functions that only do one thing,
killed off QMOPT_NEXT, and renamed DQALLOC to make it obvious it's for
dqget only.  So now we have...

xfs_qm_dqget (get dquot based on id/type, can take XFS_DQGET_DQALLOC to
allocate if not present)

xfs_qm_dqget_inode (get dquot based on inode/type, contains all the
locking and looping mess to one function, can take _DQALLOC)

xfs_qm_dqget_next (get this or the next higher dquot, no DQALLOC allowed
here, contain all the NEXT looping mess to this function)

xfs_qm_dqread (read dquot from disk and return incore dquot, do not
check in radix tree, no longer takes DQALLOC)

xfs_qm_dqiterate (iterate all the dquots for the given quota type)

I also cleaned out a bunch of unnecessary parameters and other junk,
and refactored mount time quotacheck so that it doesn't need to
ILOCK_EXCL every inode in the system.  In theory that should be fine
because we only needed ILOCK_EXCL to make sure nobody can chown/chproj
the inode on us, which shouldn't be happening during mount.

As a bonus I realized that scrub and repair don't actually need to
maintain the ilock once they're done fixing all of the things that can
cause dqget to fail, so the ILOCKED flag goes away entirely.

Will have a revised megaseries out on the list ideally some time before
LSF starts... though it did add another 12 patches to the review queue. :P

--D

> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-04-21 18:43 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18  2:39 [PATCH 00/11] xfs-4.18: online scrub fixes Darrick J. Wong
2018-04-18  2:39 ` [PATCH 01/11] xfs: skip scrub xref if corruption already noted Darrick J. Wong
2018-04-18 15:03   ` Brian Foster
2018-04-18 16:02     ` Darrick J. Wong
2018-04-18  2:39 ` [PATCH 02/11] xfs: create the XFS_QMOPT_QUOTIP_LOCKED flag Darrick J. Wong
2018-04-18 15:33   ` Brian Foster
2018-04-18 16:55     ` Darrick J. Wong
2018-04-18 17:09       ` Brian Foster
2018-04-19  8:32   ` Christoph Hellwig
2018-04-21 18:42     ` Darrick J. Wong [this message]
2018-04-18  2:39 ` [PATCH 03/11] xfs: report failing address when dquot verifier fails Darrick J. Wong
2018-04-18 18:33   ` Brian Foster
2018-04-18  2:40 ` [PATCH 04/11] xfs: refactor dquot iteration Darrick J. Wong
2018-04-18 18:34   ` Brian Foster
2018-04-18 22:20     ` Darrick J. Wong
2018-04-18  2:40 ` [PATCH 05/11] xfs: avoid ilock games in the quota scrubber Darrick J. Wong
2018-04-18 18:34   ` Brian Foster
2018-04-18  2:40 ` [PATCH 06/11] xfs: quota scrub should use bmapbtd scrubber Darrick J. Wong
2018-04-18 18:34   ` Brian Foster
2018-04-18 20:00     ` Darrick J. Wong
2018-04-19 11:20       ` Brian Foster
2018-04-18  2:40 ` [PATCH 07/11] xfs: superblock scrub should use uncached buffers Darrick J. Wong
2018-04-19 12:55   ` Brian Foster
2018-04-19 17:25     ` Darrick J. Wong
2018-04-19 18:57       ` Brian Foster
2018-04-20  0:07         ` Dave Chinner
2018-04-21  0:29           ` Darrick J. Wong
2018-04-20  0:05       ` Dave Chinner
2018-04-18  2:40 ` [PATCH 08/11] xfs: clean up scrub usage of KM_NOFS Darrick J. Wong
2018-04-19 12:55   ` Brian Foster
2018-04-18  2:40 ` [PATCH 09/11] xfs: btree scrub should check minrecs Darrick J. Wong
2018-04-19 12:55   ` Brian Foster
2018-04-18  2:40 ` [PATCH 10/11] xfs: refactor scrub transaction allocation function Darrick J. Wong
2018-04-19 12:56   ` Brian Foster
2018-04-18  2:40 ` [PATCH 11/11] xfs: avoid ABBA deadlock when scrubbing parent pointers Darrick J. Wong
2018-04-19 12:56   ` Brian Foster
2018-04-19 17:33     ` Darrick J. Wong
2018-04-19 18:58       ` Brian Foster
2018-04-19 19:06         ` Darrick J. Wong
2018-04-21  0:31           ` 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=20180421184251.GA26268@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.