All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tiger Yang <tiger.yang@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/1] ocfs2: Add extended attribute support v3
Date: Wed, 06 Aug 2008 10:34:53 +0800	[thread overview]
Message-ID: <48990DCD.7090804@oracle.com> (raw)
In-Reply-To: <20080804213404.GO28014@wotan.suse.de>


Mark Fasheh wrote:
> In order to protect against mmap changing the inline data state, you should
> hold a write lock on ip_alloc_sem across the call to ocfs2_xattr_ibody_find()
> and until the return from ocfs2_xattr_set_entry.
> 
> So basically, ocfs2_xattr_set() should look like:
> 
> ...
> down_write(&oi->ip_alloc_sem);
> ocfs2_ibody_find();
> ...
> ocfs2_xattr_set_entry();
> up_write(&oi->ip_alloc_sem);
> ...
> 
> This way mmap can't change inline data state in between the calls to
> ibody_find and xattr_set_entry.

Thanks the guide. I think I have done what your said.
In ocfs2_ibody_find(), I checked the l_count/id_count with readable 
semaphore. And in ocfs2_xattr_set_ibody, I checked it again and follow 
by ocfs2_xattr_set_entry() with writable semaphore. If mmap change 
l_count/id_count between those two function, I still have chance to know 
it. And data in struct ocfs2_xattr_search which filled in 
ocfs2_ibody_find() are not affected by mmap operations.

Best regards,
tiger

  parent reply	other threads:[~2008-08-06  2:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25 21:57 [Ocfs2-devel] [PATCH 1/1] ocfs2: Add extended attribute support v3 Mark Fasheh
2008-07-31  9:37 ` Tiger Yang
2008-08-04 21:34   ` Mark Fasheh
2008-08-05  2:39     ` Tao Ma
2008-08-05  3:51       ` Mark Fasheh
2008-08-05  4:31         ` Tao Ma
2008-08-06  2:34     ` Tiger Yang [this message]
2008-08-06 22:14       ` Mark Fasheh

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=48990DCD.7090804@oracle.com \
    --to=tiger.yang@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.