Skip to contentSkip to conversation

locks: make ->lock release private data before returning in GETLK case

PATCH Christoph Hellwig 2 participants 2 messages Apr 6, 2007 – Apr 8, 2007 VFS

lore
Share & tools
lore
#0 lore raw

fs/nfs/nfs4proc.c static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock · line 3023

Quoted 10 lines · J. Bruce Fields
fs/nfs/nfs4proc.c +2 -0
index f52cf5c..d557a51 100644
@@ -3019,6 +3019,8 @@ static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock
 			status = 0;
 	}
 out:
+	if (request->fl_ops)
+		request->fl_ops->fl_release_private(request);

Don't we know which fl_release_private instace we'll call and could do a direct call instead?

Otherwise ok.

#1 lore raw
Quoted 14 lines · Christoph Hellwig

fs/nfs/nfs4proc.c static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock · line 3023

Quoted 10 lines · J. Bruce Fields
fs/nfs/nfs4proc.c +2 -0
index f52cf5c..d557a51 100644
@@ -3019,6 +3019,8 @@ static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock
 			status = 0;
 	}
 out:
+	if (request->fl_ops)
+		request->fl_ops->fl_release_private(request);

Don't we know which fl_release_private instace we'll call and could do a direct call instead?

Yeah. It's currently private to another file, but that could obviously be fixed. The fl_ops check is still required, though. I could go either way.

--b.