public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Allison Henderson <allison.henderson@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/9] xfs: Hold inode locks in xfs_ialloc
Date: Wed, 17 Apr 2019 11:44:12 -0400	[thread overview]
Message-ID: <20190417154411.GE16377@bfoster> (raw)
In-Reply-To: <20190412225036.22939-3-allison.henderson@oracle.com>

On Fri, Apr 12, 2019 at 03:50:29PM -0700, Allison Henderson wrote:
> Modify xfs_ialloc to hold locks after return.  Caller
> will be responsible for manual unlock.  We will need
> this later to hold locks across parent pointer operations
> 
> Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
> ---

Is this needed for this series, or can it be deferred to the parent
pointer stuff? (If it is needed now, it might be a good idea to update
the commit log to explain why.)

Brian

>  fs/xfs/xfs_inode.c   | 6 +++++-
>  fs/xfs/xfs_qm.c      | 1 +
>  fs/xfs/xfs_symlink.c | 3 +++
>  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index f643a92..30a3130 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -744,6 +744,8 @@ xfs_lookup(
>   * to attach to or associate with (i.e. pip == NULL) because they
>   * are not linked into the directory structure - they are attached
>   * directly to the superblock - and so have no parent.
> + *
> + * Caller is responsible for unlocking the inode manually upon return
>   */
>  static int
>  xfs_ialloc(
> @@ -942,7 +944,7 @@ xfs_ialloc(
>  	/*
>  	 * Log the new values stuffed into the inode.
>  	 */
> -	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
> +	xfs_trans_ijoin(tp, ip, 0);
>  	xfs_trans_log_inode(tp, ip, flags);
>  
>  	/* now that we have an i_mode we can setup the inode structure */
> @@ -1264,6 +1266,7 @@ xfs_create(
>  	xfs_qm_dqrele(pdqp);
>  
>  	*ipp = ip;
> +	xfs_iunlock(ip, XFS_ILOCK_EXCL);
>  	return 0;
>  
>   out_trans_cancel:
> @@ -1359,6 +1362,7 @@ xfs_create_tmpfile(
>  	xfs_qm_dqrele(pdqp);
>  
>  	*ipp = ip;
> +	xfs_iunlock(ip, XFS_ILOCK_EXCL);
>  	return 0;
>  
>   out_trans_cancel:
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index 52ed790..69006e5 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -820,6 +820,7 @@ xfs_qm_qino_alloc(
>  	}
>  	if (need_alloc)
>  		xfs_finish_inode_setup(*ip);
> +	xfs_iunlock(*ip, XFS_ILOCK_EXCL);
>  	return error;
>  }
>  
> diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
> index b2c1177..13d31fe 100644
> --- a/fs/xfs/xfs_symlink.c
> +++ b/fs/xfs/xfs_symlink.c
> @@ -353,6 +353,7 @@ xfs_symlink(
>  	xfs_qm_dqrele(pdqp);
>  
>  	*ipp = ip;
> +	xfs_iunlock(ip, XFS_ILOCK_EXCL);
>  	return 0;
>  
>  out_trans_cancel:
> @@ -374,6 +375,8 @@ xfs_symlink(
>  
>  	if (unlock_dp_on_error)
>  		xfs_iunlock(dp, XFS_ILOCK_EXCL);
> +	if (ip)
> +		xfs_iunlock(ip, XFS_ILOCK_EXCL);
>  	return error;
>  }
>  
> -- 
> 2.7.4
> 

  reply	other threads:[~2019-04-17 15:44 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 22:50 [PATCH 0/9] xfs: Delayed Attributes Allison Henderson
2019-04-12 22:50 ` [PATCH 1/9] xfs: Remove all strlen in all xfs_attr_* functions for attr names Allison Henderson
2019-04-14 23:02   ` Dave Chinner
2019-04-15 20:08     ` Allison Henderson
2019-04-15 21:18       ` Dave Chinner
2019-04-16  1:33         ` Allison Henderson
2019-04-17 15:42   ` Brian Foster
2019-04-12 22:50 ` [PATCH 2/9] xfs: Hold inode locks in xfs_ialloc Allison Henderson
2019-04-17 15:44   ` Brian Foster [this message]
2019-04-17 17:35     ` Allison Henderson
2019-04-12 22:50 ` [PATCH 3/9] xfs: Add trans toggle to attr routines Allison Henderson
2019-04-18 15:27   ` Brian Foster
2019-04-18 21:23     ` Allison Henderson
2019-04-12 22:50 ` [PATCH 4/9] xfs: Set up infastructure for deferred attribute operations Allison Henderson
2019-04-18 15:48   ` Brian Foster
2019-04-18 21:27     ` Allison Henderson
2019-04-22 11:00       ` Brian Foster
2019-04-22 22:00         ` Allison Henderson
2019-04-12 22:50 ` [PATCH 5/9] xfs: Add xfs_attr_set_deferred and xfs_attr_remove_deferred Allison Henderson
2019-04-18 15:49   ` Brian Foster
2019-04-18 21:28     ` Allison Henderson
2019-04-22 11:01       ` Brian Foster
2019-04-22 22:01         ` Allison Henderson
2019-04-23 13:00           ` Brian Foster
2019-04-24  2:24             ` Allison Henderson
2019-04-12 22:50 ` [PATCH 6/9] xfs: Add xfs_has_attr and subroutines Allison Henderson
2019-04-15  2:46   ` Su Yue
2019-04-15 20:13     ` Allison Henderson
2019-04-22 13:00   ` Brian Foster
2019-04-22 22:01     ` Allison Henderson
2019-04-12 22:50 ` [PATCH 7/9] xfs: Add attr context to log item Allison Henderson
2019-04-15 22:50   ` Darrick J. Wong
2019-04-16  2:30     ` Allison Henderson
2019-04-16  3:21       ` Allison Henderson
2019-04-22 13:03   ` Brian Foster
2019-04-22 22:01     ` Allison Henderson
2019-04-23 13:20       ` Brian Foster
2019-04-24  2:24         ` Allison Henderson
2019-04-24  4:10           ` Darrick J. Wong
2019-04-24 12:17             ` Brian Foster
2019-04-24 15:25               ` Darrick J. Wong
2019-04-24 16:57                 ` Brian Foster
2019-04-12 22:50 ` [PATCH 8/9] xfs: Roll delayed attr operations by returning EAGAIN Allison Henderson
2019-04-15 23:31   ` Darrick J. Wong
2019-04-16 19:54     ` Allison Henderson
2019-04-23 14:19   ` Brian Foster
2019-04-24  2:24     ` Allison Henderson
2019-04-12 22:50 ` [PATCH 9/9] xfs: Remove roll_trans boolean Allison Henderson

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=20190417154411.GE16377@bfoster \
    --to=bfoster@redhat.com \
    --cc=allison.henderson@oracle.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox