Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Feb 2006 10:06:24 -0700
From:      Scott Long <scottl@samsco.org>
To:        Wei Lei <weilei84@gmail.com>
Cc:        freebsd-fs@freebsd.org, Manish Rai Jain <manishrjain@gmail.com>
Subject:   Re: Doubt about ntfs code: lockmgr with LK_INTERLOCK flag
Message-ID:  <4401E010.7070804@samsco.org>
In-Reply-To: <36fee7420602250625h7271d694i7bfc9e69eda8ade7@mail.gmail.com>
References:  <36fee7420602250625h7271d694i7bfc9e69eda8ade7@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Wei Lei wrote:

> Hi list,
> 
> Nice to be here =)
> 
> I am new here so just hope my first post doesn't mismatch the topic.
> 
> I have a doubt when understanding the ntfs code with freebsd 5.4:
> ntfs_subr.c, function ntfs_ntget().
> I understand that lockmgr() here is trying to get an exclusive lock and
> release the mutex ip->i_interlock,
> so that the protection can expand from use_count to the whole ntnode.
> 
> But what's the significance of having such a mechanism? What could possibly
> happen if I do a
> mtx_unlock first then acquire the exclusive lock?
> 

Doing a mtx_unlock() could trigger your thread to get preempted by a
higher priority thread that could then come in and modify the i_usecount
field.

Scott




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4401E010.7070804>