* Need of inode->i_mutex in xfs_write()
@ 2007-08-21 15:26 kanishk rastogi
2007-08-23 22:51 ` David Chinner
0 siblings, 1 reply; 4+ messages in thread
From: kanishk rastogi @ 2007-08-21 15:26 UTC (permalink / raw)
To: xfs
I was looking at the xfs_write code path in kernel 2.6.20 .......
I saw it acquiring inode->i_mutex .
Whats the need ?
What are we safegaurding inode for.
AFAIK its used for protecting the incode inode. (CMIIW)
regards
kanishk
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Need of inode->i_mutex in xfs_write()
2007-08-21 15:26 Need of inode->i_mutex in xfs_write() kanishk rastogi
@ 2007-08-23 22:51 ` David Chinner
2007-09-07 5:43 ` kanishk rastogi
0 siblings, 1 reply; 4+ messages in thread
From: David Chinner @ 2007-08-23 22:51 UTC (permalink / raw)
To: kanishk rastogi; +Cc: xfs
On Tue, Aug 21, 2007 at 09:11:56PM +0545, kanishk rastogi wrote:
> I was looking at the xfs_write code path in kernel 2.6.20 .......
> I saw it acquiring inode->i_mutex .
> Whats the need ?
> What are we safegaurding inode for.
See Documentation/filesystems/Locking and other files in that
directory for what i_mutex is supposed to protect.
XFS is different as it has it's own inodes and inode locks, but
it still mostly uses i_mutex inteh accepted way.
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Need of inode->i_mutex in xfs_write()
2007-08-23 22:51 ` David Chinner
@ 2007-09-07 5:43 ` kanishk rastogi
2007-09-07 12:15 ` David Chinner
0 siblings, 1 reply; 4+ messages in thread
From: kanishk rastogi @ 2007-09-07 5:43 UTC (permalink / raw)
To: David Chinner; +Cc: xfs
On 8/24/07, David Chinner <dgc@sgi.com> wrote:
> On Tue, Aug 21, 2007 at 09:11:56PM +0545, kanishk rastogi wrote:
> > I was looking at the xfs_write code path in kernel 2.6.20 .......
> > I saw it acquiring inode->i_mutex .
> > Whats the need ?
> > What are we safegaurding inode for.
>
> See Documentation/filesystems/Locking and other files in that
> directory for what i_mutex is supposed to protect.
>
> XFS is different as it has it's own inodes and inode locks, but
> it still mostly uses i_mutex inteh accepted way.
>
xfs_write comes in file_operations->aio_write()
and the documentation doesnt say anything for it to acquire i_mutex in
that path.
I still fail to understand its usage.
Where i am going wrong.
regards
kanishk
> Cheers,
>
> Dave.
> --
> Dave Chinner
> Principal Engineer
> SGI Australian Software Group
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Need of inode->i_mutex in xfs_write()
2007-09-07 5:43 ` kanishk rastogi
@ 2007-09-07 12:15 ` David Chinner
0 siblings, 0 replies; 4+ messages in thread
From: David Chinner @ 2007-09-07 12:15 UTC (permalink / raw)
To: kanishk rastogi; +Cc: David Chinner, xfs
On Fri, Sep 07, 2007 at 11:28:27AM +0545, kanishk rastogi wrote:
> On 8/24/07, David Chinner <dgc@sgi.com> wrote:
> > On Tue, Aug 21, 2007 at 09:11:56PM +0545, kanishk rastogi wrote:
> > > I was looking at the xfs_write code path in kernel 2.6.20 .......
> > > I saw it acquiring inode->i_mutex .
> > > Whats the need ?
> > > What are we safegaurding inode for.
> >
> > See Documentation/filesystems/Locking and other files in that
> > directory for what i_mutex is supposed to protect.
> >
> > XFS is different as it has it's own inodes and inode locks, but
> > it still mostly uses i_mutex inteh accepted way.
> >
>
> xfs_write comes in file_operations->aio_write()
> and the documentation doesnt say anything for it to acquire i_mutex in
> that path.
The i_mutex is supposed to be held across various calls into
generic code. See generic_file_aio_write() for the common
implementation of ->aio_write(). The entire write path is
supposed to be protected by the i_mutex.
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-09-07 12:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-21 15:26 Need of inode->i_mutex in xfs_write() kanishk rastogi
2007-08-23 22:51 ` David Chinner
2007-09-07 5:43 ` kanishk rastogi
2007-09-07 12:15 ` David Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox