From: Suresh Jayaraman <sjayaraman@suse.de>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-cifs-client@lists.samba.org, linux-fsdevel@vger.kernel.org
Subject: Re: [linux-cifs-client] [PATCH 2/4] cifs: don't leave open files dangling
Date: Mon, 24 May 2010 12:20:30 +0530 [thread overview]
Message-ID: <4BFA21B6.6010709@suse.de> (raw)
In-Reply-To: <1274466317-28231-3-git-send-email-jlayton@redhat.com>
On 05/21/2010 11:55 PM, Jeff Layton wrote:
> If we aren't going to call cifs_new_fileinfo to put the files on
> the openFileList for an inode, then they should be closed -- full stop.
>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
> fs/cifs/dir.c | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
> index 54de8e5..e11ee2e 100644
> --- a/fs/cifs/dir.c
> +++ b/fs/cifs/dir.c
> @@ -269,6 +269,8 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
> oflags);
> if (pfile_info == NULL)
> rc = -ENOMEM;
> + } else {
> + CIFSSMBClose(xid, cifs_sb->tcon, *pnetfid);
May be this not needed here as a subsequent patch pushes
cifs_new_fileinfo to the caller..?
> }
>
> posix_open_ret:
> @@ -478,11 +480,7 @@ cifs_create_set_dentry:
> else
> cFYI(1, "Create worked, get_inode_info failed rc = %d", rc);
>
> - /* nfsd case - nfs srv does not set nd */
> - if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) {
> - /* mknod case - do not leave file open */
> - CIFSSMBClose(xid, tcon, fileHandle);
> - } else if (!(posix_create) && (newinode)) {
> + if (!posix_create && newinode) {
Here too, posix_create is going to go..
May be lining this patch after [3/4] is a good idea..? Would make the
patchset simpler, I think.
> struct cifsFileInfo *pfile_info;
> /*
> * cifs_fill_filedata() takes care of setting cifsFileInfo
> @@ -492,7 +490,10 @@ cifs_create_set_dentry:
> nd->path.mnt, oflags);
> if (pfile_info == NULL)
> rc = -ENOMEM;
> + } else {
> + CIFSSMBClose(xid, tcon, fileHandle);
> }
minor nit: ^^^ unneeded braces..
> +
> cifs_create_out:
> kfree(buf);
> kfree(full_path);
--
Suresh Jayaraman
next prev parent reply other threads:[~2010-05-24 6:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-21 18:25 [PATCH 0/4] cifs: fix "Busy inodes after umount" issues (RFC) Jeff Layton
2010-05-21 18:25 ` [PATCH 1/4] cifs: make cifs_lookup return a dentry Jeff Layton
2010-05-21 18:45 ` Josef Bacik
2010-05-21 18:42 ` Jeff Layton
2010-05-22 13:30 ` Al Viro
2010-05-22 14:08 ` Jeff Layton
2010-05-22 14:46 ` Al Viro
2010-05-22 15:23 ` Jeff Layton
2010-05-21 18:25 ` [PATCH 2/4] cifs: don't leave open files dangling Jeff Layton
2010-05-24 6:50 ` Suresh Jayaraman [this message]
2010-05-24 10:49 ` [linux-cifs-client] " Jeff Layton
2010-05-21 18:25 ` [PATCH 3/4] cifs: move cifs_new_fileinfo call out of cifs_posix_open Jeff Layton
2010-05-24 6:50 ` [linux-cifs-client] " Suresh Jayaraman
2010-05-24 10:48 ` Jeff Layton
2010-05-21 18:25 ` [PATCH 4/4] cifs: pass instantiated filp back after open call Jeff Layton
2010-05-24 7:13 ` [PATCH 0/4] cifs: fix "Busy inodes after umount" issues (RFC) Suresh Jayaraman
2010-05-24 10:52 ` [linux-cifs-client] " 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=4BFA21B6.6010709@suse.de \
--to=sjayaraman@suse.de \
--cc=jlayton@redhat.com \
--cc=linux-cifs-client@lists.samba.org \
--cc=linux-fsdevel@vger.kernel.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 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).