mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tim Gardner <timg@tpi.com>
To: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
	linux-kernel@vger.kernel.org
Cc: Tim Gardner <timg@tpi.com>, Steve French <sfrench@samba.org>,
	Jeff Layton <jlayton@redhat.com>, Dean Gehnert <deang@tpi.com>
Subject: [PATCH 4/5 linux-next V2] cifs: fix incorrect reference count check
Date: Sun,  8 Dec 2013 14:08:43 -0700	[thread overview]
Message-ID: <1386536924-51726-4-git-send-email-timg@tpi.com> (raw)
In-Reply-To: <1386536924-51726-1-git-send-email-timg@tpi.com>

The reference count on tlink can only be decremented if
cifs_sb_tlink(cifs_sb) was used to acquire it. That only
happens if open_file==NULL.

Cc: Steve French <sfrench@samba.org>
Cc: Jeff Layton <jlayton@redhat.com>
Cc: Dean Gehnert <deang@tpi.com>
Signed-off-by: Tim Gardner <timg@tpi.com>
---

V2 - this is a new patch in the V2 series.

 fs/cifs/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 3f710c6..e332038 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -2007,7 +2007,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
 			CIFSSMBClose(xid, tcon, netfid);
 		}
 	}
-	if (tlink)
+	if (!open_file)
 		cifs_put_tlink(tlink);
 
 set_size_out:
-- 
1.7.9.5


  parent reply	other threads:[~2013-12-08 21:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-08 21:08 [PATCH 1/5 linux-next V2] cifs: Replace CIFSSMBSetEOF() with smb_set_file_size() Tim Gardner
2013-12-08 21:08 ` [PATCH 2/5 linux-next V2] cifs: rename set_path_size and set_file_size Tim Gardner
2013-12-09 10:59   ` Jeff Layton
2013-12-08 21:08 ` [PATCH 3/5 linux-next V2] cifs: Introduce cifs_legacy_set_file_size() Tim Gardner
2013-12-09 11:00   ` Jeff Layton
2013-12-08 21:08 ` Tim Gardner [this message]
2013-12-09 11:03   ` [PATCH 4/5 linux-next V2] cifs: fix incorrect reference count check Jeff Layton
2013-12-09 19:21     ` Tim Gardner
2013-12-08 21:08 ` [PATCH 5/5 linux-next V2] cifs: Combine set_file_size by handle and path into one function Tim Gardner
2013-12-08 21:13 ` [PATCH 5/5 linux-next V2 (resend)] " Tim Gardner
2013-12-09 11:10   ` Jeff Layton
2013-12-09 10:59 ` [PATCH 1/5 linux-next V2] cifs: Replace CIFSSMBSetEOF() with smb_set_file_size() 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=1386536924-51726-4-git-send-email-timg@tpi.com \
    --to=timg@tpi.com \
    --cc=deang@tpi.com \
    --cc=jlayton@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®