2007-05-09 17:40:17

by Nikita V. Youshchenko

[permalink] [raw]
Subject: Please assist in locating NFS race in old vendor kernel

Hello.

I'm currently working with an embedded system based on very old,
2.4.17-based, vendor kernel.

Among other issues, there is a race in NFS code, that I'm currently trying
to understand and fix.

The race is the following.
Some i/o is done on a file located on NFS-mounted filesystem. At some
moment, ftruncate() is called. And in very rare but still reproducable
cases:
- first inode->i_size is set to the new value, in process context
- then inode->i_size is restored to old value, in rpciod context.
I was able to catch this by adding some logging to the point where
__nfs_refresh_inode() updates inode->i_size.

Looks like inode size is being broken (by restore of old value) by
completeion handler of RPC operation that was started before ftruncate().

The test on which the race is reproduced more or less reliably,
is "fsx-linux" from LTP suite.

System in question is SMP - thus making race happen more often.

I guess the race is long fixed in more modern kernels.
But I'm not familiar with NFS code, and after some attempts to find
something I feel lost.

Could someone more familiar with NFS implementaion please point me where to
look?

Nikita


Attachments:
(No filename) (1.14 kB)
(No filename) (189.00 B)
Download all attachments

2007-05-12 10:33:41

by Jan Engelhardt

[permalink] [raw]
Subject: Re: Please assist in locating NFS race in old vendor kernel


On May 9 2007 21:14, Nikita V. Youshchenko wrote:
>Subject: Please assist in locating NFS race in old vendor kernel
>
>Hello.
>
>I'm currently working with an embedded system based on very old,
>2.4.17-based, vendor kernel.

Ask your vendor :-/


Jan
--