qemu-devel
[Top][All Lists]
Advanced

[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: Aneesh Kumar K. V
Subject: Re: [Qemu-devel] [PATCH -V3 6/8] hw/9pfs: Add directory reclaim support
Date: Mon, 14 Mar 2011 00:32:40 +0530
User-agent: Notmuch/0.5-66-g70c5e2c (http://notmuchmail.org) Emacs/23.1.1 (i686-pc-linux-gnu)

On Sun, 13 Mar 2011 16:42:56 +0000, Stefan Hajnoczi <address@hidden> wrote:
> 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:
> 

Will add the check

-aneesh



reply via email to

[Prev in Thread] Current Thread [Next in Thread]