Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbe601f7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:
 "Various small cifs/smb3 fixes, include some for stable, and some from
  the recent SMB3 test event"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
  File names with trailing period or space need special case conversion
  Fix reconnect to not defer smb3 session reconnect long after socket reconnect
  cifs: check hash calculating succeeded
  cifs: dynamic allocation of ntlmssp blob
  cifs: use CIFS_MAX_DOMAINNAME_LEN when converting the domain name
  cifs: stuff the fl_owner into "pid" field in the lock request
parents 5b7452c8 45e8a258
Loading
Loading
Loading
Loading
+29 −4
Original line number Diff line number Diff line
@@ -101,6 +101,12 @@ convert_sfm_char(const __u16 src_char, char *target)
	case SFM_SLASH:
		*target = '\\';
		break;
	case SFM_SPACE:
		*target = ' ';
		break;
	case SFM_PERIOD:
		*target = '.';
		break;
	default:
		return false;
	}
@@ -404,7 +410,7 @@ static __le16 convert_to_sfu_char(char src_char)
	return dest_char;
}

static __le16 convert_to_sfm_char(char src_char)
static __le16 convert_to_sfm_char(char src_char, bool end_of_string)
{
	__le16 dest_char;

@@ -427,6 +433,18 @@ static __le16 convert_to_sfm_char(char src_char)
	case '|':
		dest_char = cpu_to_le16(SFM_PIPE);
		break;
	case '.':
		if (end_of_string)
			dest_char = cpu_to_le16(SFM_PERIOD);
		else
			dest_char = 0;
		break;
	case ' ':
		if (end_of_string)
			dest_char = cpu_to_le16(SFM_SPACE);
		else
			dest_char = 0;
		break;
	default:
		dest_char = 0;
	}
@@ -469,9 +487,16 @@ cifsConvertToUTF16(__le16 *target, const char *source, int srclen,
		/* see if we must remap this char */
		if (map_chars == SFU_MAP_UNI_RSVD)
			dst_char = convert_to_sfu_char(src_char);
		else if (map_chars == SFM_MAP_UNI_RSVD)
			dst_char = convert_to_sfm_char(src_char);
		else if (map_chars == SFM_MAP_UNI_RSVD) {
			bool end_of_string;

			if (i == srclen - 1)
				end_of_string = true;
			else
				end_of_string = false;

			dst_char = convert_to_sfm_char(src_char, end_of_string);
		} else
			dst_char = 0;
		/*
		 * FIXME: We can not handle remapping backslash (UNI_SLASH)
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@
#define SFM_LESSTHAN    ((__u16) 0xF023)
#define SFM_PIPE        ((__u16) 0xF027)
#define SFM_SLASH       ((__u16) 0xF026)
#define SFM_PERIOD	((__u16) 0xF028)
#define SFM_SPACE	((__u16) 0xF029)

/*
 * Mapping mechanism to use when one of the seven reserved characters is
+3 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ extern mempool_t *cifs_req_poolp;
extern mempool_t *cifs_mid_poolp;

struct workqueue_struct	*cifsiod_wq;
__u32 cifs_lock_secret;

/*
 * Bumps refcount for cifs super block.
@@ -1266,6 +1267,8 @@ init_cifs(void)
	spin_lock_init(&cifs_file_list_lock);
	spin_lock_init(&GlobalMid_Lock);

	get_random_bytes(&cifs_lock_secret, sizeof(cifs_lock_secret));

	if (cifs_max_pending < 2) {
		cifs_max_pending = 2;
		cifs_dbg(FYI, "cifs_max_pending set to min of 2\n");
+1 −0
Original line number Diff line number Diff line
@@ -1619,6 +1619,7 @@ void cifs_oplock_break(struct work_struct *work);

extern const struct slow_work_ops cifs_oplock_break_ops;
extern struct workqueue_struct *cifsiod_wq;
extern __u32 cifs_lock_secret;

extern mempool_t *cifs_mid_poolp;

+3 −1
Original line number Diff line number Diff line
@@ -428,7 +428,9 @@ cifs_echo_request(struct work_struct *work)
	 * server->ops->need_neg() == true. Also, no need to ping if
	 * we got a response recently.
	 */
	if (!server->ops->need_neg || server->ops->need_neg(server) ||

	if (server->tcpStatus == CifsNeedReconnect ||
	    server->tcpStatus == CifsExiting || server->tcpStatus == CifsNew ||
	    (server->ops->can_echo && !server->ops->can_echo(server)) ||
	    time_before(jiffies, server->lstrp + echo_interval - HZ))
		goto requeue_echo;
Loading