From: Artem Bityutskiy <dedekind1@gmail.com>
To: Ben Shelton <ben.shelton@ni.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
Subodh Nijsure <snijsure@grid-net.com>,
linux-mtd@lists.infradead.org, adrian.hunter@intel.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] UBIFS: fix a couple bugs in UBIFS xattr length calculation
Date: Fri, 07 Nov 2014 12:34:40 +0200 [thread overview]
Message-ID: <1415356480.958.315.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <1414781431-2911-2-git-send-email-ben.shelton@ni.com>
On Fri, 2014-10-31 at 13:50 -0500, Ben Shelton wrote:
> From: Subodh Nijsure <snijsure@grid-net.com>
>
> Signed-off-by: Subodh Nijsure <snijsure@grid-net.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> Signed-off-by: Ben Shelton <ben.shelton@ni.com>
> Acked-by: Brad Mouring <brad.mouring@ni.com>
> Acked-by: Gratian Crisan <gratian.crisan@ni.com>
It looks like these patches are against an old kernel. In the new kernel
"dir_ui" was renamed to "host_ui", to show that this is not just a
directory inode, but a directory or an xattr inode (we call the "host"
inodes, since the "host" the xattr value).
I've pushed this patch in a modified form.
Do you have a possibility to test this series with a newer kernel?
Here is the patch I pushed:
>From a76284e6f89b2ae37d413fe793752257be01765a Mon Sep 17 00:00:00 2001
From: Subodh Nijsure <snijsure@grid-net.com>
Date: Fri, 31 Oct 2014 13:50:28 -0500
Subject: [PATCH] UBIFS: fix a couple bugs in UBIFS xattr length calculation
The journal update function did not work for extended attributes properly,
because extended attribute inodes carry the xattr data, and the size of this
data was not taken into account.
Artem: improved commit message, amended the patch a bit.
Signed-off-by: Subodh Nijsure <snijsure@grid-net.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Acked-by: Brad Mouring <brad.mouring@ni.com>
Acked-by: Gratian Crisan <gratian.crisan@ni.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
fs/ubifs/journal.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index fb166e2..f6ac3f2 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -571,7 +571,11 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
aligned_dlen = ALIGN(dlen, 8);
aligned_ilen = ALIGN(ilen, 8);
+
len = aligned_dlen + aligned_ilen + UBIFS_INO_NODE_SZ;
+ /* Make sure to also account for extended attributes */
+ len += host_ui->data_len;
+
dent = kmalloc(len, GFP_NOFS);
if (!dent)
return -ENOMEM;
@@ -648,7 +652,8 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
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 + host_ui->data_len);
if (err)
goto out_ro;
--
1.9.3
Artem.
next prev parent reply other threads:[~2014-11-07 10:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-31 18:50 [PATCH 0/4] UBIFS: add xattr support for security / SELinux Ben Shelton
2014-10-31 18:50 ` [PATCH 1/4] UBIFS: fix a couple bugs in UBIFS xattr length calculation Ben Shelton
2014-11-07 10:34 ` Artem Bityutskiy [this message]
2014-11-07 19:56 ` Ben Shelton
2014-10-31 18:50 ` [PATCH 2/4] UBIFS: Add xattr support for symlinks Ben Shelton
2014-11-10 14:01 ` Artem Bityutskiy
2014-11-10 17:12 ` Ben Shelton
2014-11-11 10:17 ` Artem Bityutskiy
2014-11-11 11:04 ` Artem Bityutskiy
2014-10-31 18:50 ` [PATCH 3/4] UBIFS: Add security.* XATTR support for the UBIFS Ben Shelton
2014-11-11 11:07 ` Artem Bityutskiy
2014-10-31 18:50 ` [PATCH 4/4] UBIFS: add ubifs_err() to print error reason Ben Shelton
2014-11-11 11:10 ` Artem Bityutskiy
2014-11-11 16:08 ` Ben Shelton
2014-11-12 12:31 ` Artem Bityutskiy
2014-11-07 9:53 ` [PATCH 0/4] UBIFS: add xattr support for security / SELinux Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415356480.958.315.camel@sauron.fi.intel.com \
--to=dedekind1@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=ben.shelton@ni.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mkl@pengutronix.de \
--cc=snijsure@grid-net.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox