* 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
···232232small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,233233 void **request_buf)234234{235235- int rc = 0;235235+ int rc;236236237237 rc = cifs_reconnect_tcon(tcon, smb_command);238238 if (rc)···250250 if (tcon != NULL)251251 cifs_stats_inc(&tcon->num_smbs_sent);252252253253- return rc;253253+ return 0;254254}255255256256int···281281282282/* If the return code is zero, this function must fill in request_buf pointer */283283static int284284-smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,285285- void **request_buf /* returned */ ,286286- void **response_buf /* returned */ )284284+__smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,285285+ void **request_buf, void **response_buf)287286{288288- int rc = 0;289289-290290- rc = cifs_reconnect_tcon(tcon, smb_command);291291- if (rc)292292- return rc;293293-294287 *request_buf = cifs_buf_get();295288 if (*request_buf == NULL) {296289 /* BB should we add a retry in here if not a writepage? */···302309 if (tcon != NULL)303310 cifs_stats_inc(&tcon->num_smbs_sent);304311305305- return rc;312312+ return 0;313313+}314314+315315+/* If the return code is zero, this function must fill in request_buf pointer */316316+static int317317+smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,318318+ void **request_buf, void **response_buf)319319+{320320+ int rc;321321+322322+ rc = cifs_reconnect_tcon(tcon, smb_command);323323+ if (rc)324324+ return rc;325325+326326+ return __smb_init(smb_command, wct, tcon, request_buf, response_buf);327327+}328328+329329+static int330330+smb_init_no_reconnect(int smb_command, int wct, struct cifsTconInfo *tcon,331331+ void **request_buf, void **response_buf)332332+{333333+ if (tcon->ses->need_reconnect || tcon->need_reconnect)334334+ return -EHOSTDOWN;335335+336336+ return __smb_init(smb_command, wct, tcon, request_buf, response_buf);306337}307338308339static int validate_t2(struct smb_t2_rsp *pSMB)···4551453445524535 cFYI(1, "In QFSUnixInfo");45534536QFSUnixRetry:45544554- rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,45554555- (void **) &pSMBr);45374537+ rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,45384538+ (void **) &pSMB, (void **) &pSMBr);45564539 if (rc)45574540 return rc;45584541···46214604 cFYI(1, "In SETFSUnixInfo");46224605SETFSUnixRetry:46234606 /* BB switch to small buf init to save memory */46244624- rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,46254625- (void **) &pSMBr);46074607+ rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,46084608+ (void **) &pSMB, (void **) &pSMBr);46264609 if (rc)46274610 return rc;46284611