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.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
cifs: prevent infinite recursion in cifs_reconnect_tcon
cifs: set backing_dev_info on new S_ISREG inodes

+35 -16
+33 -16
fs/cifs/cifssmb.c
··· 232 232 small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, 233 233 void **request_buf) 234 234 { 235 - int rc = 0; 235 + int rc; 236 236 237 237 rc = cifs_reconnect_tcon(tcon, smb_command); 238 238 if (rc) ··· 250 250 if (tcon != NULL) 251 251 cifs_stats_inc(&tcon->num_smbs_sent); 252 252 253 - return rc; 253 + return 0; 254 254 } 255 255 256 256 int ··· 281 281 282 282 /* If the return code is zero, this function must fill in request_buf pointer */ 283 283 static int 284 - smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, 285 - void **request_buf /* returned */ , 286 - void **response_buf /* returned */ ) 284 + __smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, 285 + void **request_buf, void **response_buf) 287 286 { 288 - int rc = 0; 289 - 290 - rc = cifs_reconnect_tcon(tcon, smb_command); 291 - if (rc) 292 - return rc; 293 - 294 287 *request_buf = cifs_buf_get(); 295 288 if (*request_buf == NULL) { 296 289 /* BB should we add a retry in here if not a writepage? */ ··· 302 309 if (tcon != NULL) 303 310 cifs_stats_inc(&tcon->num_smbs_sent); 304 311 305 - return rc; 312 + return 0; 313 + } 314 + 315 + /* If the return code is zero, this function must fill in request_buf pointer */ 316 + static int 317 + smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, 318 + void **request_buf, void **response_buf) 319 + { 320 + int rc; 321 + 322 + rc = cifs_reconnect_tcon(tcon, smb_command); 323 + if (rc) 324 + return rc; 325 + 326 + return __smb_init(smb_command, wct, tcon, request_buf, response_buf); 327 + } 328 + 329 + static int 330 + smb_init_no_reconnect(int smb_command, int wct, struct cifsTconInfo *tcon, 331 + void **request_buf, void **response_buf) 332 + { 333 + if (tcon->ses->need_reconnect || tcon->need_reconnect) 334 + return -EHOSTDOWN; 335 + 336 + return __smb_init(smb_command, wct, tcon, request_buf, response_buf); 306 337 } 307 338 308 339 static int validate_t2(struct smb_t2_rsp *pSMB) ··· 4551 4534 4552 4535 cFYI(1, "In QFSUnixInfo"); 4553 4536 QFSUnixRetry: 4554 - rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4555 - (void **) &pSMBr); 4537 + rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, 4538 + (void **) &pSMB, (void **) &pSMBr); 4556 4539 if (rc) 4557 4540 return rc; 4558 4541 ··· 4621 4604 cFYI(1, "In SETFSUnixInfo"); 4622 4605 SETFSUnixRetry: 4623 4606 /* BB switch to small buf init to save memory */ 4624 - rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4625 - (void **) &pSMBr); 4607 + rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, 4608 + (void **) &pSMB, (void **) &pSMBr); 4626 4609 if (rc) 4627 4610 return rc; 4628 4611
+2
fs/cifs/inode.c
··· 801 801 inode->i_flags |= S_NOATIME | S_NOCMTIME; 802 802 if (inode->i_state & I_NEW) { 803 803 inode->i_ino = hash; 804 + if (S_ISREG(inode->i_mode)) 805 + inode->i_data.backing_dev_info = sb->s_bdi; 804 806 #ifdef CONFIG_CIFS_FSCACHE 805 807 /* initialize per-inode cache cookie pointer */ 806 808 CIFS_I(inode)->fscache = NULL;