On 2011-08-31 07:53, JiSheng Zhang wrote:
> Hi List,
>
> I can only send email using webui now. so the patch is attached. I can
> resend the patch in email body if necessary later.
>
> The bug can only be triggered under SMP and heavy stress test.
>
> What happen is that the list_for_each_entry() loop in yaffs flush inodes
> routine can race with inodes deleting, so the inode can go away before
> list_for_each_entry() get the next node. This leads to a endless loop
> which will cause softlockup. We fix the problem by keeping reference to
> it and putting the reference only after we have safely resumed the scan
> of the inode list.
>
> Since __iget() and the inode lock are not exported, yaffs can not be selected
> as M after this change
>
> Signed-off-by: Jisheng Zhang <jszhang3@gmail.com>
> ---
> Kconfig_multi      |    2 +-
> Kconfig_single     |    2 +-
> yaffs_vfs_multi.c  |   29 ++++++++++++++++++++++++++++-
> yaffs_vfs_single.c |   24 +++++++++++++++++++++++-
> 4 files changed, 53 insertions(+), 4 deletions(-)
>

Hi JiSheng,

    I encounter the same problem with you.

    There are some questions about your patch.

1.

 

+        yaffs_gross_unlock(dev); 

+        iput(old_iptr);

+        yaffs_gross_lock(dev);

Before iput(), the gross_lock is unlocked, then in the iput funcioin, it will be locked again. My question is, can you ensure it is safe between unlock and lock?

 

2.

 +    spin_unlock(&inode_sb_list_lock);

//here should yaffs_gross_unlock(dev) also

+    iput(old_iptr);

//then yaffs_gross_lock(dev);