From: Andi Shyti <andi@etezian.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: Andi Shyti <andi@etezian.org>,
smfrench@gmail.com, linux-cifs@vger.kernel.org,
linux-kernel@vger.kernel.org, mikko.rapeli@iki.fi,
pshilovsky@samba.org
Subject: Re: [PATCH RESEND] cifs: file: initialize oparms.reconnect before using it
Date: Mon, 29 Jul 2013 18:35:32 +0200 [thread overview]
Message-ID: <20130729163532.GA4254@jack.whiskey> (raw)
In-Reply-To: <20130729093241.437315e1@corrin.poochiereds.net>
> > + oparms.tcon = tcon;
> > + oparms.cifs_sb = cifs_sb;
> > + oparms.desired_access = desired_access;
> > + oparms.create_options = create_options;
>
> This patch just moves the brokenness around. You're
> setting .desired_access here to an unintialized variable.
> create_options also looks like it may potentially be wrong at this
> point.
Urrrca! This is what I achieve when I do one last fix before
going to sleep.
I spent a bit of time more going through the cifs/smb code and
the most sensful fix looks this
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 1e57f36..7e36ae3 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -647,6 +647,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flu
oflags, &oplock, &cfile->fid.netfid, xid
if (rc == 0) {
cifs_dbg(FYI, "posix reopen succeeded\n");
+ oparms.reconnect = true;
goto reopen_success;
}
/*
There is only one case when reconnect becames false, that is when
open = smb2_open_file and calls SMB2_open() that calls
add_durable_context() that sets reconnect = false with some
nested ifs in between, and still only in case
everything succeeds. We are checking reconnect only for this
case, otherwise we could get rid of the if (oparms.reconnect) and
not falling into the unknown state.
If it makes sense, I can send the above suggestion.
Thanks,
Andi
next prev parent reply other threads:[~2013-07-29 16:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 8:58 [PATCH RESEND] cifs: file: initialize oparms.reconnect before using it Andi Shyti
2013-07-29 13:32 ` Jeff Layton
2013-07-29 16:35 ` Andi Shyti [this message]
2013-07-29 18:04 ` [PATCH v2] " Andi Shyti
2013-07-29 20:20 ` Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130729163532.GA4254@jack.whiskey \
--to=andi@etezian.org \
--cc=jlayton@redhat.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikko.rapeli@iki.fi \
--cc=pshilovsky@samba.org \
--cc=smfrench@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox