On Fri, Sep 07, 2007 at 11:28:27AM +0545, kanishk rastogi wrote:
> On 8/24/07, David Chinner <dgc@xxxxxxx> 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.
SGI Australian Software Group