[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH -V3 6/8] hw/9pfs: Add directory reclaim support
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH -V3 6/8] hw/9pfs: Add directory reclaim support |
Date: |
Sun, 13 Mar 2011 16:42:56 +0000 |
On Sat, Mar 5, 2011 at 5:52 PM, Aneesh Kumar K.V
<address@hidden> wrote:
> Signed-off-by: Aneesh Kumar K.V <address@hidden>
> ---
> hw/9pfs/virtio-9p.c | 21 +++++++++++++++++++--
> 1 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
> index 1fa7256..293a562 100644
> --- a/hw/9pfs/virtio-9p.c
> +++ b/hw/9pfs/virtio-9p.c
> @@ -142,7 +142,12 @@ static int v9fs_do_open(V9fsState *s, V9fsString *path,
> int flags)
>
> static DIR *v9fs_do_opendir(V9fsState *s, V9fsString *path)
> {
> - return s->ops->opendir(&s->ctx, path->data);
> + DIR *dir;
> + dir = s->ops->opendir(&s->ctx, path->data);
> + if (dirfd(dir) > P9_FD_RECLAIM_THRES) {
> + v9fs_reclaim_fd(s);
> + }
dirfd(NULL) will crash so we need to check !dir first:
$ cat dirfd.c
#include <stdio.h>
int main(int argc, char **argv)
{
printf("%d\n", dirfd(NULL));
return 0;
}
$ gcc -o dirfd dirfd.c
$ ./dirfd
Segmentation fault
Stefan
- Re: [Qemu-devel] [PATCH -V3 2/8] hw/9pfs: Add file descriptor reclaim support, (continued)
[Qemu-devel] [PATCH -V3 4/8] hw/9pfs: Implement syncfs, Aneesh Kumar K.V, 2011/03/05
[Qemu-devel] [PATCH -V3 5/8] hw/9pfs: Add open flag to fid, Aneesh Kumar K.V, 2011/03/05
[Qemu-devel] [PATCH -V3 6/8] hw/9pfs: Add directory reclaim support, Aneesh Kumar K.V, 2011/03/05
- Re: [Qemu-devel] [PATCH -V3 6/8] hw/9pfs: Add directory reclaim support,
Stefan Hajnoczi <=
[Qemu-devel] [PATCH -V3 8/8] hw/9pfs: Skip file system sync if we have specified cache=none option, Aneesh Kumar K.V, 2011/03/05
[Qemu-devel] [PATCH -V3 7/8] hw/9pfs: Add new virtfs option cache=none to skip host page cache, Aneesh Kumar K.V, 2011/03/05