Re: [PATCH RFC v2 4/4] 9p: fix race issue in fid contention.

2020-11-05 Thread Christian Schoenebeck
On Mittwoch, 4. November 2020 12:57:08 CET Dominique Martinet wrote: > Christian Schoenebeck wrote on Wed, Nov 04, 2020: > > > Greg, Christian - from what I understood (in private, hopefully I'm > > > allowed to repeat!), he won't be able to contribute to qemu becaus

Re: [PATCH RFC v2 4/4] 9p: fix race issue in fid contention.

2020-11-04 Thread Christian Schoenebeck
ed9bd306bd..e1c308d8d288 100644 > --- a/include/net/9p/client.h > +++ b/include/net/9p/client.h > @@ -149,7 +149,7 @@ enum fid_source { > struct p9_fid { > struct p9_client *clnt; > u32 fid; > - atomic_t count; > + refcount_t count; > int mode; > struct p9_qid qid; > u32 iounit; > diff --git a/net/9p/client.c b/net/9p/client.c > index a6c8a915e0d8..ba4910138c5b 100644 > --- a/net/9p/client.c > +++ b/net/9p/client.c > @@ -901,7 +901,7 @@ static struct p9_fid *p9_fid_create(struct p9_client > *clnt) fid->clnt = clnt; > fid->rdir = NULL; > fid->fid = 0; > - atomic_set(&fid->count, 1); > + refcount_set(&fid->count, 1); > > idr_preload(GFP_KERNEL); > spin_lock_irq(&clnt->lock); > @@ -1466,7 +1466,7 @@ int p9_client_clunk(struct p9_fid *fid) > dump_stack(); > return 0; > } > - if (!atomic_dec_and_test(&fid->count)) > + if (!refcount_dec_and_test(&fid->count)) > return 0; > > again: Best regards, Christian Schoenebeck

Re: [V9fs-developer] [PATCH RFC 0/4] 9p: fix open-unlink-f*syscall bug

2020-09-17 Thread Christian Schoenebeck
On Mittwoch, 16. September 2020 14:16:21 CEST Greg Kurz wrote: > On Mon, 14 Sep 2020 17:46:30 +0200 > > Greg Kurz wrote: > > On Mon, 14 Sep 2020 17:19:20 +0200 > > > > Christian Schoenebeck wrote: > > > On Montag, 14. September 2020 14:43:25 CEST Greg Kurz

Re: [V9fs-developer] [PATCH RFC 0/4] 9p: fix open-unlink-f*syscall bug

2020-09-14 Thread Christian Schoenebeck
ches which constiute the 1/4 - 3/4 of this > > patch set as the main frame of the solution. In patch 4/4, I fix the fid > > race issue exists in Greg's patch. > > IIRC some patches were needed on the QEMU side as well... I'm spending > less time on 9pfs in QEMU, so Cc

Re: [V9fs-developer] [PATCH RFC 0/4] 9p: fix open-unlink-f*syscall bug

2020-09-14 Thread Christian Schoenebeck
there a QEMU policy about test cases that create/write/read/delete *real* files? I.e. should those test files be written to a certain location, and are there measures of sandboxing required? Best regards, Christian Schoenebeck