Re: 2.6.2-rc2 nfsd+xfs spins in i_size_read()

Nathan Scott
2004-01-30T23:08:28Z

On Fri, Jan 30, 2004 at 02:34:59PM -0800, Andrew Morton wrote:
> Miquel van Smoorenburg <miquels@cistron.nl> wrote:
> > What lock exactly is supposed to protect i_size_write, since it
> > appears that i_size_write is being called without proper locking ?
> > (Am I right?)
>
> If two CPUs hit i_size_write() at the same time we have a bug. That
> function requires that the caller provide external serialisation, via i_sem.

Hmm... I suspect we may not always be providing that in XFS -
I'll go audit our calls.

> Try adding this to the start of i_size_write():
>
> if (down_trylock(&inode->i_sem) == 0) {
> printk("I am buggy\n");
> dump_stack();
> up(&inode->i_sem);
> }

Let me know what you hit Miquel :) - I'll run the XFS tests
next week with this too and see what I can find.

thanks.

--
Nathan