[PATCH] F_SETLEASE only on regular files.

Andreas Schneider asn at samba.org
Sun Jun 23 02:31:38 MDT 2013

On Sunday, June 23, 2013 09:38:27 you wrote:
> On Sat, Jun 22, 2013 at 10:48:56AM +0200, Andreas Schneider wrote:
> > Hello,
> > 
> > we should set a lease with
> > 
> >     ret = fcntl(fd, F_SETLEASE, leasetype);
> > 
> > in source3/smbd/oplock_linux.c only on regular files. Attached is a patch
> > to do this. I'm not a VFS expert so the questions is if we shouldn't add
> > errno (EINVAL) handling to functions which call SMB_VFS_LINUX_SETLEASE or
> > SMB_VFS_NEXT_LINUX_SETLEASE. Maybe at least to not log an error.
> Question -- what made you look at this? Is there some real
> error that you want to fix?

I got a report cause people saw the error in the log file that setting the 
lease failed for a pipe.

So if it is not a regular file we should not report and error but just 
silently skip it. So it is more about avoiding more of these kind of bug 

	-- andreas

More information about the samba-technical mailing list