From: Li Zefan <lizefan@huawei.com>
To: <gnehzuil.liu@gmail.com>
Cc: <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Ext4 Developers List <linux-ext4@vger.kernel.org>,
Jan Kara <jack@suse.cz>, "Theodore Ts'o" <tytso@mit.edu>,
Andrew Morton <akpm@linux-foundation.org>, <andi@firstfloor.org>,
Wuqixuan <wuqixuan@huawei.com>, Al Viro <viro@ZenIV.linux.org.uk>,
<gregkh@linuxfoundation.org>
Subject: Re: [RFC][PATCH] vfs: always protect diretory file->fpos with inode mutex
Date: Tue, 19 Feb 2013 20:43:14 +0800 [thread overview]
Message-ID: <51237362.201@huawei.com> (raw)
In-Reply-To: <20130219123344.GA18350@gmail.com>
On 2013/2/19 20:33, Zheng Liu wrote:
> On Tue, Feb 19, 2013 at 09:22:40AM +0800, Li Zefan wrote:
>> There's a long long-standing bug...As long as I don't know when it dates
>> from.
>>
>> I've written and attached a simple program to reproduce this bug, and it can
>> immediately trigger the bug in my box. It uses two threads, one keeps calling
>> read(), and the other calling readdir(), both on the same directory fd.
>
> Hi Zefan,
>
> Out of curiosity, why do you call read(2) on a directory fd? I only
> open(2) a directory in order to execute a flush operation to make sure
> that a file is really created.
>
Because something wrong happened in userspace programs.
After a thread closed a socket, another thread is still reading data from
this socket, but the socket fd has been re-used for opening directory for
readdir()!
next prev parent reply other threads:[~2013-02-19 12:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-19 1:22 [RFC][PATCH] vfs: always protect diretory file->fpos with inode mutex Li Zefan
2013-02-19 4:06 ` Miao Xie
2013-02-19 9:19 ` Jan Kara
2013-02-19 11:47 ` Li Zefan
2013-02-19 12:59 ` Jan Kara
2013-02-20 1:49 ` Li Zefan
2013-02-19 11:48 ` Li Zefan
2013-02-19 12:33 ` Zheng Liu
2013-02-19 12:43 ` Li Zefan [this message]
2013-02-23 17:35 ` [RFC] f_pos in readdir() (was Re: [RFC][PATCH] vfs: always protect diretory file->fpos with inode mutex) Al Viro
2013-02-25 6:09 ` Li Zefan
2013-02-25 18:25 ` Zach Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51237362.201@huawei.com \
--to=lizefan@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=gnehzuil.liu@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=viro@ZenIV.linux.org.uk \
--cc=wuqixuan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.