All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sunil Mushran <sunil.mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: Hold ip_lock when set/clear flags for indexed dir.
Date: Wed, 15 Dec 2010 12:26:25 -0800	[thread overview]
Message-ID: <4D092471.9030205@oracle.com> (raw)
In-Reply-To: <1292401800-14014-1-git-send-email-tm@tao.ma>

Acked-by Sunil Mushran <sunil.mushran@oracle.com>

On 12/15/2010 12:30 AM, Tao Ma wrote:
> From: Tao Ma<boyu.mt@taobao.com>
>
> When we set/clear the dyn_features for an inode we hold the ip_lock.
> So do it when we set/clear OCFS2_INDEXED_DIR_FL also.
>
> Signed-off-by: Tao Ma<boyu.mt@taobao.com>
> ---
>   fs/ocfs2/dir.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
> index c49f6de..d417b3f 100644
> --- a/fs/ocfs2/dir.c
> +++ b/fs/ocfs2/dir.c
> @@ -2461,8 +2461,10 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb,
>
>   	di->i_dx_root = cpu_to_le64(dr_blkno);
>
> +	spin_lock(&OCFS2_I(dir)->ip_lock);
>   	OCFS2_I(dir)->ip_dyn_features |= OCFS2_INDEXED_DIR_FL;
>   	di->i_dyn_features = cpu_to_le16(OCFS2_I(dir)->ip_dyn_features);
> +	spin_unlock(&OCFS2_I(dir)->ip_lock);
>
>   	ocfs2_journal_dirty(handle, di_bh);
>
> @@ -4466,8 +4468,10 @@ static int ocfs2_dx_dir_remove_index(struct inode *dir,
>   		goto out_commit;
>   	}
>
> +	spin_lock(&OCFS2_I(dir)->ip_lock);
>   	OCFS2_I(dir)->ip_dyn_features&= ~OCFS2_INDEXED_DIR_FL;
>   	di->i_dyn_features = cpu_to_le16(OCFS2_I(dir)->ip_dyn_features);
> +	spin_unlock(&OCFS2_I(dir)->ip_lock);
>   	di->i_dx_root = cpu_to_le64(0ULL);
>
>   	ocfs2_journal_dirty(handle, di_bh);

  reply	other threads:[~2010-12-15 20:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15  8:30 [Ocfs2-devel] [PATCH] ocfs2: Hold ip_lock when set/clear flags for indexed dir Tao Ma
2010-12-15 20:26 ` Sunil Mushran [this message]
2010-12-16  8:41 ` Joel Becker
  -- strict thread matches above, loose matches on Subject: below --
2009-04-08 21:54 Tao Ma

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=4D092471.9030205@oracle.com \
    --to=sunil.mushran@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /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.