dir.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. /*
  2. * dir.c
  3. *
  4. * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
  5. * Copyright (C) 1997 by Volker Lendecke
  6. *
  7. * Please add a note about your changes to smbfs in the ChangeLog file.
  8. */
  9. #include <linux/time.h>
  10. #include <linux/errno.h>
  11. #include <linux/kernel.h>
  12. #include <linux/smp_lock.h>
  13. #include <linux/ctype.h>
  14. #include <linux/net.h>
  15. #include <linux/sched.h>
  16. #include <linux/smb_fs.h>
  17. #include <linux/smb_mount.h>
  18. #include <linux/smbno.h>
  19. #include "smb_debug.h"
  20. #include "proto.h"
  21. static int smb_readdir(struct file *, void *, filldir_t);
  22. static int smb_dir_open(struct inode *, struct file *);
  23. static struct dentry *smb_lookup(struct inode *, struct dentry *, struct nameidata *);
  24. static int smb_create(struct inode *, struct dentry *, int, struct nameidata *);
  25. static int smb_mkdir(struct inode *, struct dentry *, int);
  26. static int smb_rmdir(struct inode *, struct dentry *);
  27. static int smb_unlink(struct inode *, struct dentry *);
  28. static int smb_rename(struct inode *, struct dentry *,
  29. struct inode *, struct dentry *);
  30. static int smb_make_node(struct inode *,struct dentry *,int,dev_t);
  31. static int smb_link(struct dentry *, struct inode *, struct dentry *);
  32. const struct file_operations smb_dir_operations =
  33. {
  34. .read = generic_read_dir,
  35. .readdir = smb_readdir,
  36. .ioctl = smb_ioctl,
  37. .open = smb_dir_open,
  38. };
  39. const struct inode_operations smb_dir_inode_operations =
  40. {
  41. .create = smb_create,
  42. .lookup = smb_lookup,
  43. .unlink = smb_unlink,
  44. .mkdir = smb_mkdir,
  45. .rmdir = smb_rmdir,
  46. .rename = smb_rename,
  47. .getattr = smb_getattr,
  48. .setattr = smb_notify_change,
  49. };
  50. const struct inode_operations smb_dir_inode_operations_unix =
  51. {
  52. .create = smb_create,
  53. .lookup = smb_lookup,
  54. .unlink = smb_unlink,
  55. .mkdir = smb_mkdir,
  56. .rmdir = smb_rmdir,
  57. .rename = smb_rename,
  58. .getattr = smb_getattr,
  59. .setattr = smb_notify_change,
  60. .symlink = smb_symlink,
  61. .mknod = smb_make_node,
  62. .link = smb_link,
  63. };
  64. /*
  65. * Read a directory, using filldir to fill the dirent memory.
  66. * smb_proc_readdir does the actual reading from the smb server.
  67. *
  68. * The cache code is almost directly taken from ncpfs
  69. */
  70. static int
  71. smb_readdir(struct file *filp, void *dirent, filldir_t filldir)
  72. {
  73. struct dentry *dentry = filp->f_path.dentry;
  74. struct inode *dir = dentry->d_inode;
  75. struct smb_sb_info *server = server_from_dentry(dentry);
  76. union smb_dir_cache *cache = NULL;
  77. struct smb_cache_control ctl;
  78. struct page *page = NULL;
  79. int result;
  80. ctl.page = NULL;
  81. ctl.cache = NULL;
  82. VERBOSE("reading %s/%s, f_pos=%d\n",
  83. DENTRY_PATH(dentry), (int) filp->f_pos);
  84. result = 0;
  85. lock_kernel();
  86. switch ((unsigned int) filp->f_pos) {
  87. case 0:
  88. if (filldir(dirent, ".", 1, 0, dir->i_ino, DT_DIR) < 0)
  89. goto out;
  90. filp->f_pos = 1;
  91. /* fallthrough */
  92. case 1:
  93. if (filldir(dirent, "..", 2, 1, parent_ino(dentry), DT_DIR) < 0)
  94. goto out;
  95. filp->f_pos = 2;
  96. }
  97. /*
  98. * Make sure our inode is up-to-date.
  99. */
  100. result = smb_revalidate_inode(dentry);
  101. if (result)
  102. goto out;
  103. page = grab_cache_page(&dir->i_data, 0);
  104. if (!page)
  105. goto read_really;
  106. ctl.cache = cache = kmap(page);
  107. ctl.head = cache->head;
  108. if (!PageUptodate(page) || !ctl.head.eof) {
  109. VERBOSE("%s/%s, page uptodate=%d, eof=%d\n",
  110. DENTRY_PATH(dentry), PageUptodate(page),ctl.head.eof);
  111. goto init_cache;
  112. }
  113. if (filp->f_pos == 2) {
  114. if (jiffies - ctl.head.time >= SMB_MAX_AGE(server))
  115. goto init_cache;
  116. /*
  117. * N.B. ncpfs checks mtime of dentry too here, we don't.
  118. * 1. common smb servers do not update mtime on dir changes
  119. * 2. it requires an extra smb request
  120. * (revalidate has the same timeout as ctl.head.time)
  121. *
  122. * Instead smbfs invalidates its own cache on local changes
  123. * and remote changes are not seen until timeout.
  124. */
  125. }
  126. if (filp->f_pos > ctl.head.end)
  127. goto finished;
  128. ctl.fpos = filp->f_pos + (SMB_DIRCACHE_START - 2);
  129. ctl.ofs = ctl.fpos / SMB_DIRCACHE_SIZE;
  130. ctl.idx = ctl.fpos % SMB_DIRCACHE_SIZE;
  131. for (;;) {
  132. if (ctl.ofs != 0) {
  133. ctl.page = find_lock_page(&dir->i_data, ctl.ofs);
  134. if (!ctl.page)
  135. goto invalid_cache;
  136. ctl.cache = kmap(ctl.page);
  137. if (!PageUptodate(ctl.page))
  138. goto invalid_cache;
  139. }
  140. while (ctl.idx < SMB_DIRCACHE_SIZE) {
  141. struct dentry *dent;
  142. int res;
  143. dent = smb_dget_fpos(ctl.cache->dentry[ctl.idx],
  144. dentry, filp->f_pos);
  145. if (!dent)
  146. goto invalid_cache;
  147. res = filldir(dirent, dent->d_name.name,
  148. dent->d_name.len, filp->f_pos,
  149. dent->d_inode->i_ino, DT_UNKNOWN);
  150. dput(dent);
  151. if (res)
  152. goto finished;
  153. filp->f_pos += 1;
  154. ctl.idx += 1;
  155. if (filp->f_pos > ctl.head.end)
  156. goto finished;
  157. }
  158. if (ctl.page) {
  159. kunmap(ctl.page);
  160. SetPageUptodate(ctl.page);
  161. unlock_page(ctl.page);
  162. page_cache_release(ctl.page);
  163. ctl.page = NULL;
  164. }
  165. ctl.idx = 0;
  166. ctl.ofs += 1;
  167. }
  168. invalid_cache:
  169. if (ctl.page) {
  170. kunmap(ctl.page);
  171. unlock_page(ctl.page);
  172. page_cache_release(ctl.page);
  173. ctl.page = NULL;
  174. }
  175. ctl.cache = cache;
  176. init_cache:
  177. smb_invalidate_dircache_entries(dentry);
  178. ctl.head.time = jiffies;
  179. ctl.head.eof = 0;
  180. ctl.fpos = 2;
  181. ctl.ofs = 0;
  182. ctl.idx = SMB_DIRCACHE_START;
  183. ctl.filled = 0;
  184. ctl.valid = 1;
  185. read_really:
  186. result = server->ops->readdir(filp, dirent, filldir, &ctl);
  187. if (result == -ERESTARTSYS && page)
  188. ClearPageUptodate(page);
  189. if (ctl.idx == -1)
  190. goto invalid_cache; /* retry */
  191. ctl.head.end = ctl.fpos - 1;
  192. ctl.head.eof = ctl.valid;
  193. finished:
  194. if (page) {
  195. cache->head = ctl.head;
  196. kunmap(page);
  197. if (result != -ERESTARTSYS)
  198. SetPageUptodate(page);
  199. unlock_page(page);
  200. page_cache_release(page);
  201. }
  202. if (ctl.page) {
  203. kunmap(ctl.page);
  204. SetPageUptodate(ctl.page);
  205. unlock_page(ctl.page);
  206. page_cache_release(ctl.page);
  207. }
  208. out:
  209. unlock_kernel();
  210. return result;
  211. }
  212. static int
  213. smb_dir_open(struct inode *dir, struct file *file)
  214. {
  215. struct dentry *dentry = file->f_path.dentry;
  216. struct smb_sb_info *server;
  217. int error = 0;
  218. VERBOSE("(%s/%s)\n", dentry->d_parent->d_name.name,
  219. file->f_path.dentry->d_name.name);
  220. /*
  221. * Directory timestamps in the core protocol aren't updated
  222. * when a file is added, so we give them a very short TTL.
  223. */
  224. lock_kernel();
  225. server = server_from_dentry(dentry);
  226. if (server->opt.protocol < SMB_PROTOCOL_LANMAN2) {
  227. unsigned long age = jiffies - SMB_I(dir)->oldmtime;
  228. if (age > 2*HZ)
  229. smb_invalid_dir_cache(dir);
  230. }
  231. /*
  232. * Note: in order to allow the smbmount process to open the
  233. * mount point, we only revalidate if the connection is valid or
  234. * if the process is trying to access something other than the root.
  235. */
  236. if (server->state == CONN_VALID || !IS_ROOT(dentry))
  237. error = smb_revalidate_inode(dentry);
  238. unlock_kernel();
  239. return error;
  240. }
  241. /*
  242. * Dentry operations routines
  243. */
  244. static int smb_lookup_validate(struct dentry *, struct nameidata *);
  245. static int smb_hash_dentry(struct dentry *, struct qstr *);
  246. static int smb_compare_dentry(struct dentry *, struct qstr *, struct qstr *);
  247. static int smb_delete_dentry(struct dentry *);
  248. static const struct dentry_operations smbfs_dentry_operations =
  249. {
  250. .d_revalidate = smb_lookup_validate,
  251. .d_hash = smb_hash_dentry,
  252. .d_compare = smb_compare_dentry,
  253. .d_delete = smb_delete_dentry,
  254. };
  255. static const struct dentry_operations smbfs_dentry_operations_case =
  256. {
  257. .d_revalidate = smb_lookup_validate,
  258. .d_delete = smb_delete_dentry,
  259. };
  260. /*
  261. * This is the callback when the dcache has a lookup hit.
  262. */
  263. static int
  264. smb_lookup_validate(struct dentry * dentry, struct nameidata *nd)
  265. {
  266. struct smb_sb_info *server = server_from_dentry(dentry);
  267. struct inode * inode = dentry->d_inode;
  268. unsigned long age = jiffies - dentry->d_time;
  269. int valid;
  270. /*
  271. * The default validation is based on dentry age:
  272. * we believe in dentries for a few seconds. (But each
  273. * successful server lookup renews the timestamp.)
  274. */
  275. valid = (age <= SMB_MAX_AGE(server));
  276. #ifdef SMBFS_DEBUG_VERBOSE
  277. if (!valid)
  278. VERBOSE("%s/%s not valid, age=%lu\n",
  279. DENTRY_PATH(dentry), age);
  280. #endif
  281. if (inode) {
  282. lock_kernel();
  283. if (is_bad_inode(inode)) {
  284. PARANOIA("%s/%s has dud inode\n", DENTRY_PATH(dentry));
  285. valid = 0;
  286. } else if (!valid)
  287. valid = (smb_revalidate_inode(dentry) == 0);
  288. unlock_kernel();
  289. } else {
  290. /*
  291. * What should we do for negative dentries?
  292. */
  293. }
  294. return valid;
  295. }
  296. static int
  297. smb_hash_dentry(struct dentry *dir, struct qstr *this)
  298. {
  299. unsigned long hash;
  300. int i;
  301. hash = init_name_hash();
  302. for (i=0; i < this->len ; i++)
  303. hash = partial_name_hash(tolower(this->name[i]), hash);
  304. this->hash = end_name_hash(hash);
  305. return 0;
  306. }
  307. static int
  308. smb_compare_dentry(struct dentry *dir, struct qstr *a, struct qstr *b)
  309. {
  310. int i, result = 1;
  311. if (a->len != b->len)
  312. goto out;
  313. for (i=0; i < a->len; i++) {
  314. if (tolower(a->name[i]) != tolower(b->name[i]))
  315. goto out;
  316. }
  317. result = 0;
  318. out:
  319. return result;
  320. }
  321. /*
  322. * This is the callback from dput() when d_count is going to 0.
  323. * We use this to unhash dentries with bad inodes.
  324. */
  325. static int
  326. smb_delete_dentry(struct dentry * dentry)
  327. {
  328. if (dentry->d_inode) {
  329. if (is_bad_inode(dentry->d_inode)) {
  330. PARANOIA("bad inode, unhashing %s/%s\n",
  331. DENTRY_PATH(dentry));
  332. return 1;
  333. }
  334. } else {
  335. /* N.B. Unhash negative dentries? */
  336. }
  337. return 0;
  338. }
  339. /*
  340. * Initialize a new dentry
  341. */
  342. void
  343. smb_new_dentry(struct dentry *dentry)
  344. {
  345. struct smb_sb_info *server = server_from_dentry(dentry);
  346. if (server->mnt->flags & SMB_MOUNT_CASE)
  347. dentry->d_op = &smbfs_dentry_operations_case;
  348. else
  349. dentry->d_op = &smbfs_dentry_operations;
  350. dentry->d_time = jiffies;
  351. }
  352. /*
  353. * Whenever a lookup succeeds, we know the parent directories
  354. * are all valid, so we want to update the dentry timestamps.
  355. * N.B. Move this to dcache?
  356. */
  357. void
  358. smb_renew_times(struct dentry * dentry)
  359. {
  360. dget(dentry);
  361. spin_lock(&dentry->d_lock);
  362. for (;;) {
  363. struct dentry *parent;
  364. dentry->d_time = jiffies;
  365. if (IS_ROOT(dentry))
  366. break;
  367. parent = dentry->d_parent;
  368. dget(parent);
  369. spin_unlock(&dentry->d_lock);
  370. dput(dentry);
  371. dentry = parent;
  372. spin_lock(&dentry->d_lock);
  373. }
  374. spin_unlock(&dentry->d_lock);
  375. dput(dentry);
  376. }
  377. static struct dentry *
  378. smb_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
  379. {
  380. struct smb_fattr finfo;
  381. struct inode *inode;
  382. int error;
  383. struct smb_sb_info *server;
  384. error = -ENAMETOOLONG;
  385. if (dentry->d_name.len > SMB_MAXNAMELEN)
  386. goto out;
  387. /* Do not allow lookup of names with backslashes in */
  388. error = -EINVAL;
  389. if (memchr(dentry->d_name.name, '\\', dentry->d_name.len))
  390. goto out;
  391. lock_kernel();
  392. error = smb_proc_getattr(dentry, &finfo);
  393. #ifdef SMBFS_PARANOIA
  394. if (error && error != -ENOENT)
  395. PARANOIA("find %s/%s failed, error=%d\n",
  396. DENTRY_PATH(dentry), error);
  397. #endif
  398. inode = NULL;
  399. if (error == -ENOENT)
  400. goto add_entry;
  401. if (!error) {
  402. error = -EACCES;
  403. finfo.f_ino = iunique(dentry->d_sb, 2);
  404. inode = smb_iget(dir->i_sb, &finfo);
  405. if (inode) {
  406. add_entry:
  407. server = server_from_dentry(dentry);
  408. if (server->mnt->flags & SMB_MOUNT_CASE)
  409. dentry->d_op = &smbfs_dentry_operations_case;
  410. else
  411. dentry->d_op = &smbfs_dentry_operations;
  412. d_add(dentry, inode);
  413. smb_renew_times(dentry);
  414. error = 0;
  415. }
  416. }
  417. unlock_kernel();
  418. out:
  419. return ERR_PTR(error);
  420. }
  421. /*
  422. * This code is common to all routines creating a new inode.
  423. */
  424. static int
  425. smb_instantiate(struct dentry *dentry, __u16 fileid, int have_id)
  426. {
  427. struct smb_sb_info *server = server_from_dentry(dentry);
  428. struct inode *inode;
  429. int error;
  430. struct smb_fattr fattr;
  431. VERBOSE("file %s/%s, fileid=%u\n", DENTRY_PATH(dentry), fileid);
  432. error = smb_proc_getattr(dentry, &fattr);
  433. if (error)
  434. goto out_close;
  435. smb_renew_times(dentry);
  436. fattr.f_ino = iunique(dentry->d_sb, 2);
  437. inode = smb_iget(dentry->d_sb, &fattr);
  438. if (!inode)
  439. goto out_no_inode;
  440. if (have_id) {
  441. struct smb_inode_info *ei = SMB_I(inode);
  442. ei->fileid = fileid;
  443. ei->access = SMB_O_RDWR;
  444. ei->open = server->generation;
  445. }
  446. d_instantiate(dentry, inode);
  447. out:
  448. return error;
  449. out_no_inode:
  450. error = -EACCES;
  451. out_close:
  452. if (have_id) {
  453. PARANOIA("%s/%s failed, error=%d, closing %u\n",
  454. DENTRY_PATH(dentry), error, fileid);
  455. smb_close_fileid(dentry, fileid);
  456. }
  457. goto out;
  458. }
  459. /* N.B. How should the mode argument be used? */
  460. static int
  461. smb_create(struct inode *dir, struct dentry *dentry, int mode,
  462. struct nameidata *nd)
  463. {
  464. struct smb_sb_info *server = server_from_dentry(dentry);
  465. __u16 fileid;
  466. int error;
  467. struct iattr attr;
  468. VERBOSE("creating %s/%s, mode=%d\n", DENTRY_PATH(dentry), mode);
  469. lock_kernel();
  470. smb_invalid_dir_cache(dir);
  471. error = smb_proc_create(dentry, 0, get_seconds(), &fileid);
  472. if (!error) {
  473. if (server->opt.capabilities & SMB_CAP_UNIX) {
  474. /* Set attributes for new file */
  475. attr.ia_valid = ATTR_MODE;
  476. attr.ia_mode = mode;
  477. error = smb_proc_setattr_unix(dentry, &attr, 0, 0);
  478. }
  479. error = smb_instantiate(dentry, fileid, 1);
  480. } else {
  481. PARANOIA("%s/%s failed, error=%d\n",
  482. DENTRY_PATH(dentry), error);
  483. }
  484. unlock_kernel();
  485. return error;
  486. }
  487. /* N.B. How should the mode argument be used? */
  488. static int
  489. smb_mkdir(struct inode *dir, struct dentry *dentry, int mode)
  490. {
  491. struct smb_sb_info *server = server_from_dentry(dentry);
  492. int error;
  493. struct iattr attr;
  494. lock_kernel();
  495. smb_invalid_dir_cache(dir);
  496. error = smb_proc_mkdir(dentry);
  497. if (!error) {
  498. if (server->opt.capabilities & SMB_CAP_UNIX) {
  499. /* Set attributes for new directory */
  500. attr.ia_valid = ATTR_MODE;
  501. attr.ia_mode = mode;
  502. error = smb_proc_setattr_unix(dentry, &attr, 0, 0);
  503. }
  504. error = smb_instantiate(dentry, 0, 0);
  505. }
  506. unlock_kernel();
  507. return error;
  508. }
  509. static int
  510. smb_rmdir(struct inode *dir, struct dentry *dentry)
  511. {
  512. struct inode *inode = dentry->d_inode;
  513. int error;
  514. /*
  515. * Close the directory if it's open.
  516. */
  517. lock_kernel();
  518. smb_close(inode);
  519. /*
  520. * Check that nobody else is using the directory..
  521. */
  522. error = -EBUSY;
  523. if (!d_unhashed(dentry))
  524. goto out;
  525. smb_invalid_dir_cache(dir);
  526. error = smb_proc_rmdir(dentry);
  527. out:
  528. unlock_kernel();
  529. return error;
  530. }
  531. static int
  532. smb_unlink(struct inode *dir, struct dentry *dentry)
  533. {
  534. int error;
  535. /*
  536. * Close the file if it's open.
  537. */
  538. lock_kernel();
  539. smb_close(dentry->d_inode);
  540. smb_invalid_dir_cache(dir);
  541. error = smb_proc_unlink(dentry);
  542. if (!error)
  543. smb_renew_times(dentry);
  544. unlock_kernel();
  545. return error;
  546. }
  547. static int
  548. smb_rename(struct inode *old_dir, struct dentry *old_dentry,
  549. struct inode *new_dir, struct dentry *new_dentry)
  550. {
  551. int error;
  552. /*
  553. * Close any open files, and check whether to delete the
  554. * target before attempting the rename.
  555. */
  556. lock_kernel();
  557. if (old_dentry->d_inode)
  558. smb_close(old_dentry->d_inode);
  559. if (new_dentry->d_inode) {
  560. smb_close(new_dentry->d_inode);
  561. error = smb_proc_unlink(new_dentry);
  562. if (error) {
  563. VERBOSE("unlink %s/%s, error=%d\n",
  564. DENTRY_PATH(new_dentry), error);
  565. goto out;
  566. }
  567. /* FIXME */
  568. d_delete(new_dentry);
  569. }
  570. smb_invalid_dir_cache(old_dir);
  571. smb_invalid_dir_cache(new_dir);
  572. error = smb_proc_mv(old_dentry, new_dentry);
  573. if (!error) {
  574. smb_renew_times(old_dentry);
  575. smb_renew_times(new_dentry);
  576. }
  577. out:
  578. unlock_kernel();
  579. return error;
  580. }
  581. /*
  582. * FIXME: samba servers won't let you create device nodes unless uid/gid
  583. * matches the connection credentials (and we don't know which those are ...)
  584. */
  585. static int
  586. smb_make_node(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
  587. {
  588. int error;
  589. struct iattr attr;
  590. attr.ia_valid = ATTR_MODE | ATTR_UID | ATTR_GID;
  591. attr.ia_mode = mode;
  592. current_euid_egid(&attr.ia_uid, &attr.ia_gid);
  593. if (!new_valid_dev(dev))
  594. return -EINVAL;
  595. smb_invalid_dir_cache(dir);
  596. error = smb_proc_setattr_unix(dentry, &attr, MAJOR(dev), MINOR(dev));
  597. if (!error) {
  598. error = smb_instantiate(dentry, 0, 0);
  599. }
  600. return error;
  601. }
  602. /*
  603. * dentry = existing file
  604. * new_dentry = new file
  605. */
  606. static int
  607. smb_link(struct dentry *dentry, struct inode *dir, struct dentry *new_dentry)
  608. {
  609. int error;
  610. DEBUG1("smb_link old=%s/%s new=%s/%s\n",
  611. DENTRY_PATH(dentry), DENTRY_PATH(new_dentry));
  612. smb_invalid_dir_cache(dir);
  613. error = smb_proc_link(server_from_dentry(dentry), dentry, new_dentry);
  614. if (!error) {
  615. smb_renew_times(dentry);
  616. error = smb_instantiate(new_dentry, 0, 0);
  617. }
  618. return error;
  619. }