linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Steve French <smfrench@gmail.com>,
	"linux-cifs-client@lists.samba.org"
	<linux-cifs-client@lists.samba.org>,
	viro@zeniv.linux.org.uk,
	Trond Myklebust <trond.myklebust@fys.uio.no>
Subject: Re: [patch] utilize lookup intents to open in lookup
Date: Thu, 9 Apr 2009 10:00:19 -0400	[thread overview]
Message-ID: <20090409100019.35ca2e35@barsoom.rdu.redhat.com> (raw)
In-Reply-To: <4a4634330904090646v32f469f3g2303f64a75ff7389@mail.gmail.com>

On Thu, 9 Apr 2009 08:46:07 -0500
Shirish Pargaonkar <shirishpargaonkar@gmail.com> wrote:
> >> @@ -632,12 +655,27 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
> >>       }
> >>       cFYI(1, ("Full path: %s inode = 0x%p", full_path, direntry->d_inode));
> >>
> >> -     if (pTcon->unix_ext)
> >> -             rc = cifs_get_inode_info_unix(&newInode, full_path,
> >> -                                           parent_dir_inode->i_sb, xid);
> >> -     else
> >> +     if (pTcon->unix_ext) {
> >> +             if (!(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) &&
> >> +                             (nd->flags & LOOKUP_OPEN)) {
> >> +                     if (!((nd->intent.open.flags & O_CREAT) &&
> >> +                                     (nd->intent.open.flags & O_EXCL))) {
> >> +                             mode = nd->intent.open.create_mode &
> >> +                                             ~current->fs->umask;
> >> +                             rc = cifs_posix_open(full_path, &newInode,
> >> +                                     parent_dir_inode->i_sb, mode,
> >> +                                     nd->intent.open.flags, &oplock,
> >> +                                     &fileHandle, xid);
> >> +                             if ((rc != -EINVAL) && (rc != -EOPNOTSUPP))
> >                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > This looks wrong to me.  It's possible that you'd get a different
> > return code here on an unsuccessful open call? Why would we want to
> > instantiate the filp on any error from cifs_posix_open? For instance,
> > that function can return -ENOMEM. I don't think we want to instantiate
> > the filp in that case.
> 
> Jeff,
> 
> Thanks, will handle the identation/formatting errors in a subsequent patch
> for sure.
> 
> If there is any other error code returned besides these two error codes,
> it is handled as an error, so file pointer will not be instantiated
> (as posix_open
> will be true).
> These two errors are there to handle the bug in samba posix open and
> if either of these error codes are returned, cifs_lookup does what it
> had been doing (as posix_open will be false),.
> 

Ok, thanks for clarifying that. Maybe a comment in there to explain
that would be helpful too?

-- 
Jeff Layton <jlayton@redhat.com>

      reply	other threads:[~2009-04-09 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 16:57 [linux-cifs-client][patch] utilize lookup intents to open in lookup Shirish Pargaonkar
2009-04-01 19:33 ` Shirish Pargaonkar
2009-04-09 12:55   ` Jeff Layton
2009-04-09 13:46     ` Shirish Pargaonkar
2009-04-09 14:00       ` Jeff Layton [this message]

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=20090409100019.35ca2e35@barsoom.rdu.redhat.com \
    --to=jlayton@redhat.com \
    --cc=linux-cifs-client@lists.samba.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=shirishpargaonkar@gmail.com \
    --cc=smfrench@gmail.com \
    --cc=trond.myklebust@fys.uio.no \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).