Commit 184012ad authored by Kirill Smelkov's avatar Kirill Smelkov

dtlk: remove double call to nonseekable_open

dtlk_open currently has 2 calls to nonseekable_open which are both
executed on success path. It was not hurting to make the extra call as
nonseekable_open is only changing file->f_flags in idempotent way.
However the first nonseekable_open is indeed both unneeded and looks
suspicious.

The first nonseekable_open was added in 6244f13c ("Fix up a couple of
drivers - notable sg - for nonseekability."; 2004-Aug-7). The second
nonseekable_open call was introduced in dc5c7245 ("Remove ESPIPE logic
from drivers, letting the VFS layer handle it instead.; 2004-Aug-8). The
latter patch being mass change probably missed to remove
nonseekable_open that was introduced into dtlk_open the day before.

Fix it: remove the extra/unneeded nonseekable_open call and leave the
call to nonseekable_open only on the path where we are actually opening
the file.
Suggested-by: default avatarPavel Machek <pavel@denx.de>
Signed-off-by: Kirill Smelkov's avatarKirill Smelkov <kirr@nexedi.com>
parent e93c9c99
......@@ -298,7 +298,6 @@ static int dtlk_open(struct inode *inode, struct file *file)
{
TRACE_TEXT("(dtlk_open");
nonseekable_open(inode, file);
switch (iminor(inode)) {
case DTLK_MINOR:
if (dtlk_busy)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment