On Wed, Oct 12 2016, Jeff Layton wrote: >> - fl_owner = lockowner->l_owner; >> + if (l_ctx == NULL) >> + fl_owner = current->files; >> + else >> + fl_owner = l_ctx->lockowner.l_owner; > > > This I'm less sure of. Suppose we have only a flock lock on a file and > then truncate it. This is going to miss finding that stateid, no? > > I wonder if we need to look harder at the state to determine which owner to use in this case? I didn't think this was possible with the current API, but I had forgotten about (or never knew about) ATTR_FILE. setattr does have access to the file, so it can find all the nfs state info needed. And when I modify the patch series to make use of that, it removes some ugly bits :-) I'll repost after a little testing. Thanks, NeilBrown
Attachment:
signature.asc
Description: PGP signature