lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 18 Apr 2008 14:47:53 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	bfields@...ldses.org
CC:	miklos@...redi.hu, trond.myklebust@....uio.no,
	eshel@...aden.ibm.com, neilb@...e.de, akpm@...ux-foundation.org,
	linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: nfs: infinite loop in fcntl(F_SETLKW)

> > > > 1) if !FL_SLEEP, then return 0 if granted, -EAGAIN on contention
> > > > 2) if FL_SLEEP and fl_grant == NULL, then return 0 if granted, block on
> > > >    contention
> > > > 3) if FL_SLEEP and fl_grant != NULL, then return 0 if granted, on
> > > >    contention:
> > > >    a) either return -EINPROGRESS and call fl_grant when granted
> > > >    b) or return -EAGAIN  and call fl_notify when the lock needs retrying
> > > 
> > > I'd put it this way (after a quick check of the code to convince myself
> > > I'm remembering this right...):
> > > 
> > >   1) If FL_SLEEP, then return 0 if granted, and on contention either:
> > >      a) block, or
> > >      b) return -EAGAIN, and call fl_notify when the lock should be
> > >         retried.
> > 
> > Gfs2 seems to return -EINPROGRESS regardless of the FL_SLEEP flag:
> 
> Oops, you're right; in FL_SLEEP case fs/lockd/svclock.c:nlmsvc_lock() 
> returns NLM_LCK_BLOCKED.  I believe it'll get an fl_grant() callback
> after that and do a grant call back to the client, but I haven't
> checked....
> 
> Note, as has been pointed out by Mark Snitzer
> (http://article.gmane.org/gmane.linux.nfs/17801/), this limits the kind
> of error reporting the filesystem can do--if it needs to block on the
> initial lock call, it has to commit to queueing up, and eventually
> granting, the lock.

OK, but that AFAICS is a lock manager implementation issue, not an API
issue.  Which is important, but not as important as the API ;)

> > > OK, but I haven't read your patch yet, apologies....
> > 
> > No problem.  Here it is again with some cosmetic fixes and testing.
> 
> Thanks!  Ping me in a couple days if I haven't made any comments.  From
> a quick skim the GFS2 change and the error return change both seem
> reasonable.
> 
> I need to a real GFS2 testing setup....  (Did you test GFS2 locking
> specifically?)

No gfs2, only ext3.

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ