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