From: Eric Sandeen <sandeen@sandeen.net>
To: Rich Johnston <rjohnston@sgi.com>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfsdump: add locks around the inventory put
Date: Tue, 01 Oct 2013 16:06:36 -0500 [thread overview]
Message-ID: <524B395C.6030705@sandeen.net> (raw)
In-Reply-To: <524AF8C3.8020904@sgi.com>
hi Rich -
On 10/1/13 11:30 AM, Rich Johnston wrote:
> From: Phil White <cerise-xfs@l.armory.com>
>
> Add locks around the inventory put to prevent inventory
> corruption.
>
> Signed-off-by: Phil White <cerise-xfs@l.armory.com>
Similar questions here; it says it's thread-safe, but apparently
not. But why not? what happens? Is there a testcase?
(you guys probably have longer history in ptools, maybe you
can see what if anything changed since the original comment
was added - or maybe when it was added, etc?)
Thanks,
-Eric
> diff --git a/dump/content.c b/dump/content.c
> index ac19021..b8977bb 100644
> --- a/dump/content.c
> +++ b/dump/content.c
> @@ -2550,8 +2550,11 @@ decision_more:
> scwhdrp->cih_startpt.sp_offset );
> }
>
> - /* already thread-safe, don't need to lock
> + /* Supposedly already thread-safe, according to the
> + * previous revisions, but corruption of inventory
> + * objects can occur.
> */
> */
> + lock();
> ok = inv_put_mediafile( inv_stmt,
> &mwhdrp->mh_mediaid,
> mwhdrp->mh_medialabel,
> @@ -2565,6 +2568,7 @@ decision_more:
> &&
> ! empty_mediafile,
> BOOL_FALSE );
> + unlock();
> if ( ! ok ) {
> mlog( MLOG_NORMAL, _(
> "inventory media file put failed\n") );
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-10-01 21:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 16:30 [PATCH] xfsdump: add locks around the inventory put Rich Johnston
2013-10-01 21:06 ` Eric Sandeen [this message]
2013-10-01 22:19 ` Rich Johnston
2013-10-03 14:17 ` Rich Johnston
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=524B395C.6030705@sandeen.net \
--to=sandeen@sandeen.net \
--cc=rjohnston@sgi.com \
--cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox