diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-03-02 23:09:00 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-03-02 23:09:00 +0000 |
commit | 3b55ead1ecded0269b7b3278220515a1f06a03ec (patch) | |
tree | e1ea68f9ffc159db7dfa3a0f3580840d6f55e1ff /target/linux | |
parent | b3c5f308fc39dadf39523347db884ae3e6a8d862 (diff) | |
download | master-187ad058-3b55ead1ecded0269b7b3278220515a1f06a03ec.tar.gz master-187ad058-3b55ead1ecded0269b7b3278220515a1f06a03ec.tar.bz2 master-187ad058-3b55ead1ecded0269b7b3278220515a1f06a03ec.zip |
linux/3.2: add symlink xattr support to ubifs
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30794 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/generic/patches-3.2/550-ubifs-symlink-xattr-support.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/generic/patches-3.2/550-ubifs-symlink-xattr-support.patch b/target/linux/generic/patches-3.2/550-ubifs-symlink-xattr-support.patch new file mode 100644 index 0000000000..1b11fe79e6 --- /dev/null +++ b/target/linux/generic/patches-3.2/550-ubifs-symlink-xattr-support.patch @@ -0,0 +1,67 @@ +--- a/fs/ubifs/file.c ++++ b/fs/ubifs/file.c +@@ -1575,6 +1575,12 @@ const struct inode_operations ubifs_syml + .follow_link = ubifs_follow_link, + .setattr = ubifs_setattr, + .getattr = ubifs_getattr, ++#ifdef CONFIG_UBIFS_FS_XATTR ++ .setxattr = ubifs_setxattr, ++ .getxattr = ubifs_getxattr, ++ .listxattr = ubifs_listxattr, ++ .removexattr = ubifs_removexattr, ++#endif + }; + + const struct file_operations ubifs_file_operations = { +--- a/fs/ubifs/journal.c ++++ b/fs/ubifs/journal.c +@@ -553,7 +553,8 @@ int ubifs_jnl_update(struct ubifs_info * + + dbg_jnl("ino %lu, dent '%.*s', data len %d in dir ino %lu", + inode->i_ino, nm->len, nm->name, ui->data_len, dir->i_ino); +- ubifs_assert(dir_ui->data_len == 0); ++ if (!xent) ++ ubifs_assert(dir_ui->data_len == 0); + ubifs_assert(mutex_is_locked(&dir_ui->ui_mutex)); + + dlen = UBIFS_DENT_NODE_SZ + nm->len + 1; +@@ -573,6 +574,13 @@ int ubifs_jnl_update(struct ubifs_info * + aligned_dlen = ALIGN(dlen, 8); + aligned_ilen = ALIGN(ilen, 8); + len = aligned_dlen + aligned_ilen + UBIFS_INO_NODE_SZ; ++ if (xent) { ++ /* ++ * Make sure to account for dir_ui->data_len in ++ * length calculation in case there is extended attribute. ++ */ ++ len += dir_ui->data_len; ++ } + dent = kmalloc(len, GFP_NOFS); + if (!dent) + return -ENOMEM; +@@ -649,7 +657,8 @@ int ubifs_jnl_update(struct ubifs_info * + + ino_key_init(c, &ino_key, dir->i_ino); + ino_offs += aligned_ilen; +- err = ubifs_tnc_add(c, &ino_key, lnum, ino_offs, UBIFS_INO_NODE_SZ); ++ err = ubifs_tnc_add(c, &ino_key, lnum, ino_offs, ++ UBIFS_INO_NODE_SZ + dir_ui->data_len); + if (err) + goto out_ro; + +--- a/fs/ubifs/xattr.c ++++ b/fs/ubifs/xattr.c +@@ -211,12 +211,12 @@ static int change_xattr(struct ubifs_inf + } + memcpy(ui->data, value, size); + inode->i_size = ui->ui_size = size; +- ui->data_len = size; + + mutex_lock(&host_ui->ui_mutex); + host->i_ctime = ubifs_current_time(host); + host_ui->xattr_size -= CALC_XATTR_BYTES(ui->data_len); + host_ui->xattr_size += CALC_XATTR_BYTES(size); ++ ui->data_len = size; + + /* + * It is important to write the host inode after the xattr inode |