xattr.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. /*
  2. * This file is part of UBIFS.
  3. *
  4. * Copyright (C) 2006-2008 Nokia Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published by
  8. * the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program; if not, write to the Free Software Foundation, Inc., 51
  17. * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  18. *
  19. * Authors: Artem Bityutskiy (Битюцкий Артём)
  20. * Adrian Hunter
  21. */
  22. /*
  23. * This file implements UBIFS extended attributes support.
  24. *
  25. * Extended attributes are implemented as regular inodes with attached data,
  26. * which limits extended attribute size to UBIFS block size (4KiB). Names of
  27. * extended attributes are described by extended attribute entries (xentries),
  28. * which are almost identical to directory entries, but have different key type.
  29. *
  30. * In other words, the situation with extended attributes is very similar to
  31. * directories. Indeed, any inode (but of course not xattr inodes) may have a
  32. * number of associated xentries, just like directory inodes have associated
  33. * directory entries. Extended attribute entries store the name of the extended
  34. * attribute, the host inode number, and the extended attribute inode number.
  35. * Similarly, direntries store the name, the parent and the target inode
  36. * numbers. Thus, most of the common UBIFS mechanisms may be re-used for
  37. * extended attributes.
  38. *
  39. * The number of extended attributes is not limited, but there is Linux
  40. * limitation on the maximum possible size of the list of all extended
  41. * attributes associated with an inode (%XATTR_LIST_MAX), so UBIFS makes sure
  42. * the sum of all extended attribute names of the inode does not exceed that
  43. * limit.
  44. *
  45. * Extended attributes are synchronous, which means they are written to the
  46. * flash media synchronously and there is no write-back for extended attribute
  47. * inodes. The extended attribute values are not stored in compressed form on
  48. * the media.
  49. *
  50. * Since extended attributes are represented by regular inodes, they are cached
  51. * in the VFS inode cache. The xentries are cached in the LNC cache (see
  52. * tnc.c).
  53. *
  54. * ACL support is not implemented.
  55. */
  56. #include "ubifs.h"
  57. #include <linux/fs.h>
  58. #include <linux/slab.h>
  59. #include <linux/xattr.h>
  60. #include <linux/posix_acl_xattr.h>
  61. /*
  62. * Limit the number of extended attributes per inode so that the total size
  63. * (@xattr_size) is guaranteeded to fit in an 'unsigned int'.
  64. */
  65. #define MAX_XATTRS_PER_INODE 65535
  66. /*
  67. * Extended attribute type constants.
  68. *
  69. * USER_XATTR: user extended attribute ("user.*")
  70. * TRUSTED_XATTR: trusted extended attribute ("trusted.*)
  71. * SECURITY_XATTR: security extended attribute ("security.*")
  72. */
  73. enum {
  74. USER_XATTR,
  75. TRUSTED_XATTR,
  76. SECURITY_XATTR,
  77. };
  78. static const struct inode_operations empty_iops;
  79. static const struct file_operations empty_fops;
  80. /**
  81. * create_xattr - create an extended attribute.
  82. * @c: UBIFS file-system description object
  83. * @host: host inode
  84. * @nm: extended attribute name
  85. * @value: extended attribute value
  86. * @size: size of extended attribute value
  87. *
  88. * This is a helper function which creates an extended attribute of name @nm
  89. * and value @value for inode @host. The host inode is also updated on flash
  90. * because the ctime and extended attribute accounting data changes. This
  91. * function returns zero in case of success and a negative error code in case
  92. * of failure.
  93. */
  94. static int create_xattr(struct ubifs_info *c, struct inode *host,
  95. const struct qstr *nm, const void *value, int size)
  96. {
  97. int err, names_len;
  98. struct inode *inode;
  99. struct ubifs_inode *ui, *host_ui = ubifs_inode(host);
  100. struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
  101. .new_ino_d = ALIGN(size, 8), .dirtied_ino = 1,
  102. .dirtied_ino_d = ALIGN(host_ui->data_len, 8) };
  103. if (host_ui->xattr_cnt >= MAX_XATTRS_PER_INODE) {
  104. ubifs_err(c, "inode %lu already has too many xattrs (%d), cannot create more",
  105. host->i_ino, host_ui->xattr_cnt);
  106. return -ENOSPC;
  107. }
  108. /*
  109. * Linux limits the maximum size of the extended attribute names list
  110. * to %XATTR_LIST_MAX. This means we should not allow creating more
  111. * extended attributes if the name list becomes larger. This limitation
  112. * is artificial for UBIFS, though.
  113. */
  114. names_len = host_ui->xattr_names + host_ui->xattr_cnt + nm->len + 1;
  115. if (names_len > XATTR_LIST_MAX) {
  116. ubifs_err(c, "cannot add one more xattr name to inode %lu, total names length would become %d, max. is %d",
  117. host->i_ino, names_len, XATTR_LIST_MAX);
  118. return -ENOSPC;
  119. }
  120. err = ubifs_budget_space(c, &req);
  121. if (err)
  122. return err;
  123. inode = ubifs_new_inode(c, host, S_IFREG | S_IRWXUGO);
  124. if (IS_ERR(inode)) {
  125. err = PTR_ERR(inode);
  126. goto out_budg;
  127. }
  128. /* Re-define all operations to be "nothing" */
  129. inode->i_mapping->a_ops = &empty_aops;
  130. inode->i_op = &empty_iops;
  131. inode->i_fop = &empty_fops;
  132. inode->i_flags |= S_SYNC | S_NOATIME | S_NOCMTIME | S_NOQUOTA;
  133. ui = ubifs_inode(inode);
  134. ui->xattr = 1;
  135. ui->flags |= UBIFS_XATTR_FL;
  136. ui->data = kmemdup(value, size, GFP_NOFS);
  137. if (!ui->data) {
  138. err = -ENOMEM;
  139. goto out_free;
  140. }
  141. inode->i_size = ui->ui_size = size;
  142. ui->data_len = size;
  143. mutex_lock(&host_ui->ui_mutex);
  144. host->i_ctime = ubifs_current_time(host);
  145. host_ui->xattr_cnt += 1;
  146. host_ui->xattr_size += CALC_DENT_SIZE(nm->len);
  147. host_ui->xattr_size += CALC_XATTR_BYTES(size);
  148. host_ui->xattr_names += nm->len;
  149. err = ubifs_jnl_update(c, host, nm, inode, 0, 1);
  150. if (err)
  151. goto out_cancel;
  152. mutex_unlock(&host_ui->ui_mutex);
  153. ubifs_release_budget(c, &req);
  154. insert_inode_hash(inode);
  155. iput(inode);
  156. return 0;
  157. out_cancel:
  158. host_ui->xattr_cnt -= 1;
  159. host_ui->xattr_size -= CALC_DENT_SIZE(nm->len);
  160. host_ui->xattr_size -= CALC_XATTR_BYTES(size);
  161. host_ui->xattr_names -= nm->len;
  162. mutex_unlock(&host_ui->ui_mutex);
  163. out_free:
  164. make_bad_inode(inode);
  165. iput(inode);
  166. out_budg:
  167. ubifs_release_budget(c, &req);
  168. return err;
  169. }
  170. /**
  171. * change_xattr - change an extended attribute.
  172. * @c: UBIFS file-system description object
  173. * @host: host inode
  174. * @inode: extended attribute inode
  175. * @value: extended attribute value
  176. * @size: size of extended attribute value
  177. *
  178. * This helper function changes the value of extended attribute @inode with new
  179. * data from @value. Returns zero in case of success and a negative error code
  180. * in case of failure.
  181. */
  182. static int change_xattr(struct ubifs_info *c, struct inode *host,
  183. struct inode *inode, const void *value, int size)
  184. {
  185. int err;
  186. struct ubifs_inode *host_ui = ubifs_inode(host);
  187. struct ubifs_inode *ui = ubifs_inode(inode);
  188. void *buf = NULL;
  189. struct ubifs_budget_req req = { .dirtied_ino = 2,
  190. .dirtied_ino_d = ALIGN(size, 8) + ALIGN(host_ui->data_len, 8) };
  191. ubifs_assert(ui->data_len == inode->i_size);
  192. err = ubifs_budget_space(c, &req);
  193. if (err)
  194. return err;
  195. buf = kmemdup(value, size, GFP_NOFS);
  196. if (!buf) {
  197. err = -ENOMEM;
  198. goto out_free;
  199. }
  200. mutex_lock(&ui->ui_mutex);
  201. kfree(ui->data);
  202. ui->data = buf;
  203. inode->i_size = ui->ui_size = size;
  204. ui->data_len = size;
  205. mutex_unlock(&ui->ui_mutex);
  206. mutex_lock(&host_ui->ui_mutex);
  207. host->i_ctime = ubifs_current_time(host);
  208. host_ui->xattr_size -= CALC_XATTR_BYTES(ui->data_len);
  209. host_ui->xattr_size += CALC_XATTR_BYTES(size);
  210. /*
  211. * It is important to write the host inode after the xattr inode
  212. * because if the host inode gets synchronized (via 'fsync()'), then
  213. * the extended attribute inode gets synchronized, because it goes
  214. * before the host inode in the write-buffer.
  215. */
  216. err = ubifs_jnl_change_xattr(c, inode, host);
  217. if (err)
  218. goto out_cancel;
  219. mutex_unlock(&host_ui->ui_mutex);
  220. ubifs_release_budget(c, &req);
  221. return 0;
  222. out_cancel:
  223. host_ui->xattr_size -= CALC_XATTR_BYTES(size);
  224. host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len);
  225. mutex_unlock(&host_ui->ui_mutex);
  226. make_bad_inode(inode);
  227. out_free:
  228. ubifs_release_budget(c, &req);
  229. return err;
  230. }
  231. /**
  232. * check_namespace - check extended attribute name-space.
  233. * @nm: extended attribute name
  234. *
  235. * This function makes sure the extended attribute name belongs to one of the
  236. * supported extended attribute name-spaces. Returns name-space index in case
  237. * of success and a negative error code in case of failure.
  238. */
  239. static int check_namespace(const struct qstr *nm)
  240. {
  241. int type;
  242. if (nm->len > UBIFS_MAX_NLEN)
  243. return -ENAMETOOLONG;
  244. if (!strncmp(nm->name, XATTR_TRUSTED_PREFIX,
  245. XATTR_TRUSTED_PREFIX_LEN)) {
  246. if (nm->name[sizeof(XATTR_TRUSTED_PREFIX) - 1] == '\0')
  247. return -EINVAL;
  248. type = TRUSTED_XATTR;
  249. } else if (!strncmp(nm->name, XATTR_USER_PREFIX,
  250. XATTR_USER_PREFIX_LEN)) {
  251. if (nm->name[XATTR_USER_PREFIX_LEN] == '\0')
  252. return -EINVAL;
  253. type = USER_XATTR;
  254. } else if (!strncmp(nm->name, XATTR_SECURITY_PREFIX,
  255. XATTR_SECURITY_PREFIX_LEN)) {
  256. if (nm->name[sizeof(XATTR_SECURITY_PREFIX) - 1] == '\0')
  257. return -EINVAL;
  258. type = SECURITY_XATTR;
  259. } else
  260. return -EOPNOTSUPP;
  261. return type;
  262. }
  263. static struct inode *iget_xattr(struct ubifs_info *c, ino_t inum)
  264. {
  265. struct inode *inode;
  266. inode = ubifs_iget(c->vfs_sb, inum);
  267. if (IS_ERR(inode)) {
  268. ubifs_err(c, "dead extended attribute entry, error %d",
  269. (int)PTR_ERR(inode));
  270. return inode;
  271. }
  272. if (ubifs_inode(inode)->xattr)
  273. return inode;
  274. ubifs_err(c, "corrupt extended attribute entry");
  275. iput(inode);
  276. return ERR_PTR(-EINVAL);
  277. }
  278. static int setxattr(struct inode *host, const char *name, const void *value,
  279. size_t size, int flags)
  280. {
  281. struct inode *inode;
  282. struct ubifs_info *c = host->i_sb->s_fs_info;
  283. struct qstr nm = QSTR_INIT(name, strlen(name));
  284. struct ubifs_dent_node *xent;
  285. union ubifs_key key;
  286. int err, type;
  287. ubifs_assert(mutex_is_locked(&host->i_mutex));
  288. if (size > UBIFS_MAX_INO_DATA)
  289. return -ERANGE;
  290. type = check_namespace(&nm);
  291. if (type < 0)
  292. return type;
  293. xent = kmalloc(UBIFS_MAX_XENT_NODE_SZ, GFP_NOFS);
  294. if (!xent)
  295. return -ENOMEM;
  296. /*
  297. * The extended attribute entries are stored in LNC, so multiple
  298. * look-ups do not involve reading the flash.
  299. */
  300. xent_key_init(c, &key, host->i_ino, &nm);
  301. err = ubifs_tnc_lookup_nm(c, &key, xent, &nm);
  302. if (err) {
  303. if (err != -ENOENT)
  304. goto out_free;
  305. if (flags & XATTR_REPLACE)
  306. /* We are asked not to create the xattr */
  307. err = -ENODATA;
  308. else
  309. err = create_xattr(c, host, &nm, value, size);
  310. goto out_free;
  311. }
  312. if (flags & XATTR_CREATE) {
  313. /* We are asked not to replace the xattr */
  314. err = -EEXIST;
  315. goto out_free;
  316. }
  317. inode = iget_xattr(c, le64_to_cpu(xent->inum));
  318. if (IS_ERR(inode)) {
  319. err = PTR_ERR(inode);
  320. goto out_free;
  321. }
  322. err = change_xattr(c, host, inode, value, size);
  323. iput(inode);
  324. out_free:
  325. kfree(xent);
  326. return err;
  327. }
  328. int ubifs_setxattr(struct dentry *dentry, const char *name,
  329. const void *value, size_t size, int flags)
  330. {
  331. dbg_gen("xattr '%s', host ino %lu ('%pd'), size %zd",
  332. name, d_inode(dentry)->i_ino, dentry, size);
  333. return setxattr(d_inode(dentry), name, value, size, flags);
  334. }
  335. ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf,
  336. size_t size)
  337. {
  338. struct inode *inode, *host = d_inode(dentry);
  339. struct ubifs_info *c = host->i_sb->s_fs_info;
  340. struct qstr nm = QSTR_INIT(name, strlen(name));
  341. struct ubifs_inode *ui;
  342. struct ubifs_dent_node *xent;
  343. union ubifs_key key;
  344. int err;
  345. dbg_gen("xattr '%s', ino %lu ('%pd'), buf size %zd", name,
  346. host->i_ino, dentry, size);
  347. err = check_namespace(&nm);
  348. if (err < 0)
  349. return err;
  350. xent = kmalloc(UBIFS_MAX_XENT_NODE_SZ, GFP_NOFS);
  351. if (!xent)
  352. return -ENOMEM;
  353. xent_key_init(c, &key, host->i_ino, &nm);
  354. err = ubifs_tnc_lookup_nm(c, &key, xent, &nm);
  355. if (err) {
  356. if (err == -ENOENT)
  357. err = -ENODATA;
  358. goto out_unlock;
  359. }
  360. inode = iget_xattr(c, le64_to_cpu(xent->inum));
  361. if (IS_ERR(inode)) {
  362. err = PTR_ERR(inode);
  363. goto out_unlock;
  364. }
  365. ui = ubifs_inode(inode);
  366. ubifs_assert(inode->i_size == ui->data_len);
  367. ubifs_assert(ubifs_inode(host)->xattr_size > ui->data_len);
  368. mutex_lock(&ui->ui_mutex);
  369. if (buf) {
  370. /* If @buf is %NULL we are supposed to return the length */
  371. if (ui->data_len > size) {
  372. ubifs_err(c, "buffer size %zd, xattr len %d",
  373. size, ui->data_len);
  374. err = -ERANGE;
  375. goto out_iput;
  376. }
  377. memcpy(buf, ui->data, ui->data_len);
  378. }
  379. err = ui->data_len;
  380. out_iput:
  381. mutex_unlock(&ui->ui_mutex);
  382. iput(inode);
  383. out_unlock:
  384. kfree(xent);
  385. return err;
  386. }
  387. ssize_t ubifs_listxattr(struct dentry *dentry, char *buffer, size_t size)
  388. {
  389. union ubifs_key key;
  390. struct inode *host = d_inode(dentry);
  391. struct ubifs_info *c = host->i_sb->s_fs_info;
  392. struct ubifs_inode *host_ui = ubifs_inode(host);
  393. struct ubifs_dent_node *xent, *pxent = NULL;
  394. int err, len, written = 0;
  395. struct qstr nm = { .name = NULL };
  396. dbg_gen("ino %lu ('%pd'), buffer size %zd", host->i_ino,
  397. dentry, size);
  398. len = host_ui->xattr_names + host_ui->xattr_cnt;
  399. if (!buffer)
  400. /*
  401. * We should return the minimum buffer size which will fit a
  402. * null-terminated list of all the extended attribute names.
  403. */
  404. return len;
  405. if (len > size)
  406. return -ERANGE;
  407. lowest_xent_key(c, &key, host->i_ino);
  408. while (1) {
  409. int type;
  410. xent = ubifs_tnc_next_ent(c, &key, &nm);
  411. if (IS_ERR(xent)) {
  412. err = PTR_ERR(xent);
  413. break;
  414. }
  415. nm.name = xent->name;
  416. nm.len = le16_to_cpu(xent->nlen);
  417. type = check_namespace(&nm);
  418. if (unlikely(type < 0)) {
  419. err = type;
  420. break;
  421. }
  422. /* Show trusted namespace only for "power" users */
  423. if (type != TRUSTED_XATTR || capable(CAP_SYS_ADMIN)) {
  424. memcpy(buffer + written, nm.name, nm.len + 1);
  425. written += nm.len + 1;
  426. }
  427. kfree(pxent);
  428. pxent = xent;
  429. key_read(c, &xent->key, &key);
  430. }
  431. kfree(pxent);
  432. if (err != -ENOENT) {
  433. ubifs_err(c, "cannot find next direntry, error %d", err);
  434. return err;
  435. }
  436. ubifs_assert(written <= size);
  437. return written;
  438. }
  439. static int remove_xattr(struct ubifs_info *c, struct inode *host,
  440. struct inode *inode, const struct qstr *nm)
  441. {
  442. int err;
  443. struct ubifs_inode *host_ui = ubifs_inode(host);
  444. struct ubifs_inode *ui = ubifs_inode(inode);
  445. struct ubifs_budget_req req = { .dirtied_ino = 2, .mod_dent = 1,
  446. .dirtied_ino_d = ALIGN(host_ui->data_len, 8) };
  447. ubifs_assert(ui->data_len == inode->i_size);
  448. err = ubifs_budget_space(c, &req);
  449. if (err)
  450. return err;
  451. mutex_lock(&host_ui->ui_mutex);
  452. host->i_ctime = ubifs_current_time(host);
  453. host_ui->xattr_cnt -= 1;
  454. host_ui->xattr_size -= CALC_DENT_SIZE(nm->len);
  455. host_ui->xattr_size -= CALC_XATTR_BYTES(ui->data_len);
  456. host_ui->xattr_names -= nm->len;
  457. err = ubifs_jnl_delete_xattr(c, host, inode, nm);
  458. if (err)
  459. goto out_cancel;
  460. mutex_unlock(&host_ui->ui_mutex);
  461. ubifs_release_budget(c, &req);
  462. return 0;
  463. out_cancel:
  464. host_ui->xattr_cnt += 1;
  465. host_ui->xattr_size += CALC_DENT_SIZE(nm->len);
  466. host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len);
  467. host_ui->xattr_names += nm->len;
  468. mutex_unlock(&host_ui->ui_mutex);
  469. ubifs_release_budget(c, &req);
  470. make_bad_inode(inode);
  471. return err;
  472. }
  473. int ubifs_removexattr(struct dentry *dentry, const char *name)
  474. {
  475. struct inode *inode, *host = d_inode(dentry);
  476. struct ubifs_info *c = host->i_sb->s_fs_info;
  477. struct qstr nm = QSTR_INIT(name, strlen(name));
  478. struct ubifs_dent_node *xent;
  479. union ubifs_key key;
  480. int err;
  481. dbg_gen("xattr '%s', ino %lu ('%pd')", name,
  482. host->i_ino, dentry);
  483. ubifs_assert(mutex_is_locked(&host->i_mutex));
  484. err = check_namespace(&nm);
  485. if (err < 0)
  486. return err;
  487. xent = kmalloc(UBIFS_MAX_XENT_NODE_SZ, GFP_NOFS);
  488. if (!xent)
  489. return -ENOMEM;
  490. xent_key_init(c, &key, host->i_ino, &nm);
  491. err = ubifs_tnc_lookup_nm(c, &key, xent, &nm);
  492. if (err) {
  493. if (err == -ENOENT)
  494. err = -ENODATA;
  495. goto out_free;
  496. }
  497. inode = iget_xattr(c, le64_to_cpu(xent->inum));
  498. if (IS_ERR(inode)) {
  499. err = PTR_ERR(inode);
  500. goto out_free;
  501. }
  502. ubifs_assert(inode->i_nlink == 1);
  503. clear_nlink(inode);
  504. err = remove_xattr(c, host, inode, &nm);
  505. if (err)
  506. set_nlink(inode, 1);
  507. /* If @i_nlink is 0, 'iput()' will delete the inode */
  508. iput(inode);
  509. out_free:
  510. kfree(xent);
  511. return err;
  512. }
  513. static int init_xattrs(struct inode *inode, const struct xattr *xattr_array,
  514. void *fs_info)
  515. {
  516. const struct xattr *xattr;
  517. char *name;
  518. int err = 0;
  519. for (xattr = xattr_array; xattr->name != NULL; xattr++) {
  520. name = kmalloc(XATTR_SECURITY_PREFIX_LEN +
  521. strlen(xattr->name) + 1, GFP_NOFS);
  522. if (!name) {
  523. err = -ENOMEM;
  524. break;
  525. }
  526. strcpy(name, XATTR_SECURITY_PREFIX);
  527. strcpy(name + XATTR_SECURITY_PREFIX_LEN, xattr->name);
  528. err = setxattr(inode, name, xattr->value, xattr->value_len, 0);
  529. kfree(name);
  530. if (err < 0)
  531. break;
  532. }
  533. return err;
  534. }
  535. int ubifs_init_security(struct inode *dentry, struct inode *inode,
  536. const struct qstr *qstr)
  537. {
  538. int err;
  539. err = security_inode_init_security(inode, dentry, qstr,
  540. &init_xattrs, 0);
  541. if (err) {
  542. struct ubifs_info *c = dentry->i_sb->s_fs_info;
  543. ubifs_err(c, "cannot initialize security for inode %lu, error %d",
  544. inode->i_ino, err);
  545. }
  546. return err;
  547. }