From: Steve French <smfrench@gmail.com>
To: simo <idra@samba.org>
Cc: Jeremy Allison <jra@samba.org>, Jeff Layton <jlayton@redhat.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
"linux-cifs-client@lists.samba.org"
<linux-cifs-client@lists.samba.org>,
samba-technical <samba-technical@lists.samba.org>
Subject: Re: [linux-cifs-client] [CIFS] [PATCH] warn on EINVAL error on posix open, and turn off posix open if server broken for this call
Date: Wed, 4 Mar 2009 13:30:31 -0600 [thread overview]
Message-ID: <524f69650903041130p14d92b89r9edec5a469ec3d2c@mail.gmail.com> (raw)
In-Reply-To: <1236194670.22692.0.camel@pico.li.ssimo.org>
We still do posix open in the cifs_create (file creation) path since
that does not appear to be broken:
if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) &&
(CIFS_UNIX_POSIX_PATH_OPS_CAP &
le64_to_cpu(tcon->fsUnixInfo.Capability))) {
rc = cifs_posix_open(full_path, &newinode, inode->i_sb,
mode, oflags, &oplock, &fileHandle, xid);
and if we try to reopen file, we still try reopening posix first (since reopen
is rarer, and not performance sensitive, it is ok to try twice)
We just disable it in the cifs_open (not create) path:
if (!tcon->broken_posix_open && tcon->unix_ext &&
(tcon->ses->capabilities & CAP_UNIX) &&
(CIFS_UNIX_POSIX_PATH_OPS_CAP &
le64_to_cpu(tcon->fsUnixInfo.Capability))) {
int oflags = (int) cifs_posix_convert_flags(file->f_flags);
/* can not refresh inode info since size could be stale */
rc = cifs_posix_open(full_path, &inode, inode->i_sb,
cifs_sb->mnt_file_mode /* ignored */,
oflags, &oplock, &netfid, xid);
if (rc == 0) {
cFYI(1, ("posix open succeeded"));
/* no need for special case handling of setting mode
on read only files needed here */
cifs_posix_open_inode_helper(inode, file, pCifsInode,
pCifsFile, oplock, netfid);
goto out;
} else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
if (tcon->ses->serverNOS)
cERROR(1, ("server %s of type %s returned"
" unexpected error on SMB posix open"
", disabling posix open support."
" Check if server update available.",
tcon->ses->serverName,
tcon->ses->serverNOS));
On Wed, Mar 4, 2009 at 1:24 PM, simo <idra@samba.org> wrote:
> On Wed, 2009-03-04 at 13:02 -0600, Steve French wrote:
>> Attached is patch to workaround the problem found in posix open to
>> Samba versions 3.3.1 and earlier
>> (create works, but open would fail with invalid parameter) - it
>> disables requests to try posix open after
>> a first failure.
>
> Why do you completely disable posix opens ?
> Wouldn't it make sense to reopen only when it fails ?
> After all when you create new files it works correctly.
>
> Simo.
>
> --
> Simo Sorce
> Samba Team GPL Compliance Officer <simo@samba.org>
> Principal Software Engineer at Red Hat, Inc. <simo@redhat.com>
>
>
--
Thanks,
Steve
next prev parent reply other threads:[~2009-03-04 19:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-04 19:02 [CIFS] [PATCH] warn on EINVAL error on posix open, and turn off posix open if server broken for this call Steve French
2009-03-04 19:24 ` simo
2009-03-04 19:29 ` Jeremy Allison
2009-03-04 19:34 ` [linux-cifs-client] " Steve French
2009-03-04 19:30 ` Steve French [this message]
2009-03-04 20:36 ` simo
2009-03-04 19:29 ` Shirish Pargaonkar
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=524f69650903041130p14d92b89r9edec5a469ec3d2c@mail.gmail.com \
--to=smfrench@gmail.com \
--cc=idra@samba.org \
--cc=jlayton@redhat.com \
--cc=jra@samba.org \
--cc=linux-cifs-client@lists.samba.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=samba-technical@lists.samba.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.