lockd: fix nlm_close_files
[ Upstream commit 1197eb5906a5464dbaea24cac296dfc38499cc00 ] This loop condition tries a bit too hard to be clever. Just test for the two indices we care about explicitly. Cc: J. Bruce Fields <bfields@fieldses.org> Fixes: 7f024fcd5c97 ("Keep read and write fds with each nlm_file") Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
486c1acf14
commit
795f9fa1b5
@@ -283,11 +283,10 @@ nlm_file_inuse(struct nlm_file *file)
|
|||||||
|
|
||||||
static void nlm_close_files(struct nlm_file *file)
|
static void nlm_close_files(struct nlm_file *file)
|
||||||
{
|
{
|
||||||
struct file *f;
|
if (file->f_file[O_RDONLY])
|
||||||
|
nlmsvc_ops->fclose(file->f_file[O_RDONLY]);
|
||||||
for (f = file->f_file[0]; f <= file->f_file[1]; f++)
|
if (file->f_file[O_WRONLY])
|
||||||
if (f)
|
nlmsvc_ops->fclose(file->f_file[O_WRONLY]);
|
||||||
nlmsvc_ops->fclose(f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user