Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.samba.org/sfrench/cifs-2.6

* git://git.samba.org/sfrench/cifs-2.6:
cifs: check for NULL last_entry before calling cifs_save_resume_key
cifs: attempt to freeze while looping on a receive attempt
cifs: Fix sparse warning when calling cifs_strtoUCS
CIFS: Add descriptions to the brlock cache functions

+39 -5
+2
fs/cifs/connect.c
··· 441 441 smb_msg.msg_controllen = 0; 442 442 443 443 for (total_read = 0; to_read; total_read += length, to_read -= length) { 444 + try_to_freeze(); 445 + 444 446 if (server_unresponsive(server)) { 445 447 total_read = -EAGAIN; 446 448 break;
+26
fs/cifs/file.c
··· 702 702 lock->type, lock->netfid, conf_lock); 703 703 } 704 704 705 + /* 706 + * Check if there is another lock that prevents us to set the lock (mandatory 707 + * style). If such a lock exists, update the flock structure with its 708 + * properties. Otherwise, set the flock type to F_UNLCK if we can cache brlocks 709 + * or leave it the same if we can't. Returns 0 if we don't need to request to 710 + * the server or 1 otherwise. 711 + */ 705 712 static int 706 713 cifs_lock_test(struct cifsInodeInfo *cinode, __u64 offset, __u64 length, 707 714 __u8 type, __u16 netfid, struct file_lock *flock) ··· 746 739 mutex_unlock(&cinode->lock_mutex); 747 740 } 748 741 742 + /* 743 + * Set the byte-range lock (mandatory style). Returns: 744 + * 1) 0, if we set the lock and don't need to request to the server; 745 + * 2) 1, if no locks prevent us but we need to request to the server; 746 + * 3) -EACCESS, if there is a lock that prevents us and wait is false. 747 + */ 749 748 static int 750 749 cifs_lock_add_if(struct cifsInodeInfo *cinode, struct cifsLockInfo *lock, 751 750 bool wait) ··· 791 778 return rc; 792 779 } 793 780 781 + /* 782 + * Check if there is another lock that prevents us to set the lock (posix 783 + * style). If such a lock exists, update the flock structure with its 784 + * properties. Otherwise, set the flock type to F_UNLCK if we can cache brlocks 785 + * or leave it the same if we can't. Returns 0 if we don't need to request to 786 + * the server or 1 otherwise. 787 + */ 794 788 static int 795 789 cifs_posix_lock_test(struct file *file, struct file_lock *flock) 796 790 { ··· 820 800 return rc; 821 801 } 822 802 803 + /* 804 + * Set the byte-range lock (posix style). Returns: 805 + * 1) 0, if we set the lock and don't need to request to the server; 806 + * 2) 1, if we need to request to the server; 807 + * 3) <0, if the error occurs while setting the lock. 808 + */ 823 809 static int 824 810 cifs_posix_lock_set(struct file *file, struct file_lock *flock) 825 811 {
+8 -2
fs/cifs/readdir.c
··· 554 554 rc); 555 555 return rc; 556 556 } 557 - cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile); 557 + /* FindFirst/Next set last_entry to NULL on malformed reply */ 558 + if (cifsFile->srch_inf.last_entry) 559 + cifs_save_resume_key(cifsFile->srch_inf.last_entry, 560 + cifsFile); 558 561 } 559 562 560 563 while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) && ··· 565 562 cFYI(1, "calling findnext2"); 566 563 rc = CIFSFindNext(xid, pTcon, cifsFile->netfid, 567 564 &cifsFile->srch_inf); 568 - cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile); 565 + /* FindFirst/Next set last_entry to NULL on malformed reply */ 566 + if (cifsFile->srch_inf.last_entry) 567 + cifs_save_resume_key(cifsFile->srch_inf.last_entry, 568 + cifsFile); 569 569 if (rc) 570 570 return -ENOENT; 571 571 }
+3 -3
fs/cifs/smbencrypt.c
··· 209 209 { 210 210 int rc; 211 211 int len; 212 - __u16 wpwd[129]; 212 + __le16 wpwd[129]; 213 213 214 214 /* Password cannot be longer than 128 characters */ 215 215 if (passwd) /* Password must be converted to NT unicode */ ··· 219 219 *wpwd = 0; /* Ensure string is null terminated */ 220 220 } 221 221 222 - rc = mdfour(p16, (unsigned char *) wpwd, len * sizeof(__u16)); 223 - memset(wpwd, 0, 129 * sizeof(__u16)); 222 + rc = mdfour(p16, (unsigned char *) wpwd, len * sizeof(__le16)); 223 + memset(wpwd, 0, 129 * sizeof(__le16)); 224 224 225 225 return rc; 226 226 }