Thread (41 messages) 41 messages, 3 authors, 2021-01-28

Re: [PATCH 11/13] xfs: refactor inode creation transaction/inode/quota allocation idiom

From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-01-28 18:32:39

On Thu, Jan 28, 2021 at 09:57:37AM +0000, Christoph Hellwig wrote:
On Wed, Jan 27, 2021 at 10:02:06PM -0800, Darrick J. Wong wrote:
quoted
From: Darrick J. Wong <djwong@kernel.org>

For file creation, create a new helper xfs_trans_alloc_icreate that
allocates a transaction and reserves the appropriate amount of quota
against that transction.  Replace all the open-coded idioms with a
single call to this helper so that we can contain the retry loops in the
next patchset.
For most callers this moves the call to xfs_trans_reserve_quota_icreate
out of the ilock criticial section.  Which seems fine and actually
mildly desirable.  But please document it.
Ok, done.  Add this as a second paragraph:

"This changes the locking behavior for non-tempfile creation slightly,
in that we now make the quota reservation without holding the directory
ILOCK.  While the dquots chosen for inode creation are based on the
directory state at a given point in time, the directory ILOCK was
released as soon as the dquot references are picked up.  Hence it was
never necessary to hold the directory ILOCK for the quota reservation."

--D
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help