Skip to content

Commit 67a865a

Browse files
committed
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fixes from Steve French: "A small set of cifs fixes which includes one for a recent regression in the write path (pointed out by Anton), some fixes for rename problems and as promised for 3.9 removing the obsolete sockopt mount option (and the accompanying deprecation warning)." * 'for-next' of git://git.samba.org/sfrench/cifs-2.6: CIFS: Fix missing of oplock_read value in smb30_values structure cifs: don't try to unlock pagecache page after releasing it cifs: remove the sockopt= mount option cifs: Check server capability before attempting silly rename cifs: Fix bug when checking error condition in cifs_rename_pending_delete()
2 parents 59d8e5e + 067785c commit 67a865a

4 files changed

Lines changed: 13 additions & 17 deletions

File tree

‎fs/cifs/cifssmb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,12 +1909,12 @@ cifs_writev_requeue(struct cifs_writedata *wdata)
19091909
} while (rc == -EAGAIN);
19101910

19111911
for (i = 0; i < wdata->nr_pages; i++) {
1912+
unlock_page(wdata->pages[i]);
19121913
if (rc != 0) {
19131914
SetPageError(wdata->pages[i]);
19141915
end_page_writeback(wdata->pages[i]);
19151916
page_cache_release(wdata->pages[i]);
19161917
}
1917-
unlock_page(wdata->pages[i]);
19181918
}
19191919

19201920
mapping_set_error(inode->i_mapping, rc);

‎fs/cifs/connect.c‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ enum {
9797
Opt_user, Opt_pass, Opt_ip,
9898
Opt_unc, Opt_domain,
9999
Opt_srcaddr, Opt_prefixpath,
100-
Opt_iocharset, Opt_sockopt,
100+
Opt_iocharset,
101101
Opt_netbiosname, Opt_servern,
102102
Opt_ver, Opt_vers, Opt_sec, Opt_cache,
103103

@@ -202,7 +202,6 @@ static const match_table_t cifs_mount_option_tokens = {
202202
{ Opt_srcaddr, "srcaddr=%s" },
203203
{ Opt_prefixpath, "prefixpath=%s" },
204204
{ Opt_iocharset, "iocharset=%s" },
205-
{ Opt_sockopt, "sockopt=%s" },
206205
{ Opt_netbiosname, "netbiosname=%s" },
207206
{ Opt_servern, "servern=%s" },
208207
{ Opt_ver, "ver=%s" },
@@ -1752,19 +1751,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
17521751
*/
17531752
cFYI(1, "iocharset set to %s", string);
17541753
break;
1755-
case Opt_sockopt:
1756-
string = match_strdup(args);
1757-
if (string == NULL)
1758-
goto out_nomem;
1759-
1760-
if (strnicmp(string, "TCP_NODELAY", 11) == 0) {
1761-
printk(KERN_WARNING "CIFS: the "
1762-
"sockopt=TCP_NODELAY option has been "
1763-
"deprecated and will be removed "
1764-
"in 3.9\n");
1765-
vol->sockopt_tcp_nodelay = 1;
1766-
}
1767-
break;
17681754
case Opt_netbiosname:
17691755
string = match_strdup(args);
17701756
if (string == NULL)

‎fs/cifs/inode.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,15 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
995995
return PTR_ERR(tlink);
996996
tcon = tlink_tcon(tlink);
997997

998+
/*
999+
* We cannot rename the file if the server doesn't support
1000+
* CAP_INFOLEVEL_PASSTHRU
1001+
*/
1002+
if (!(tcon->ses->capabilities & CAP_INFOLEVEL_PASSTHRU)) {
1003+
rc = -EBUSY;
1004+
goto out;
1005+
}
1006+
9981007
rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN,
9991008
DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR,
10001009
&netfid, &oplock, NULL, cifs_sb->local_nls,
@@ -1023,7 +1032,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
10231032
current->tgid);
10241033
/* although we would like to mark the file hidden
10251034
if that fails we will still try to rename it */
1026-
if (rc != 0)
1035+
if (!rc)
10271036
cifsInode->cifsAttrs = dosattr;
10281037
else
10291038
dosattr = origattr; /* since not able to change them */

‎fs/cifs/smb2ops.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,4 +744,5 @@ struct smb_version_values smb30_values = {
744744
.cap_unix = 0,
745745
.cap_nt_find = SMB2_NT_FIND,
746746
.cap_large_files = SMB2_LARGE_FILES,
747+
.oplock_read = SMB2_OPLOCK_LEVEL_II,
747748
};

0 commit comments

Comments
 (0)