Skip to contentSkip to conversation

ubifs: Change log level in ubifs_xattr_get

PATCH In review [email protected] 2 participants 3 messages Jan 10, 2018 – Jan 11, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ubifs: Change log level in ubifs_xattr_get

From: Rock Lee <[email protected]>

Just print warning message when xattr value size is bigger than the buffer size. There is a situation that other modules, like overlayfs, try to get xattr value with a small buffer, if they get -ERANGE, they will try again with the proper buffer size. No need to report a error message, warning message is enough.

---
 fs/ubifs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ubifs/xattr.c +1 -1
index 5ddc89d..bc20530 100644
@@ -381,7 +381,7 @@ ssize_t ubifs_xattr_get(struct inode *host, const char *name, void *buf,
 	if (buf) {
 		/* If @buf is %NULL we are supposed to return the length */
 		if (ui->data_len > size) {
-			ubifs_err(c, "buffer size %zd, xattr len %d",
+			ubifs_warn(c, "buffer size %zd, xattr len %d",
 				  size, ui->data_len);
 			err = -ERANGE;
 			goto out_iput;
Signature · 1 line
1.9.1
#1 lore raw

Rock Lee,

Am Mittwoch, 10. Januar 2018, 11:05:41 CET schrieb [email protected]:

Quoted 18 lines

From: Rock Lee <[email protected]>

Just print warning message when xattr value size is bigger than the buffer size. There is a situation that other modules, like overlayfs, try to get xattr value with a small buffer, if they get -ERANGE, they will try again with the proper buffer size. No need to report a error message, warning message is enough.

---
 fs/ubifs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ubifs/xattr.c +0 -0
index 5ddc89d..bc20530 100644

fs/ubifs/xattr.c ssize_t ubifs_xattr_get(struct inode *host, const char · line 385

Quoted 6 lines
fs/ubifs/xattr.c +1 -1
@@ -381,7 +381,7 @@ ssize_t ubifs_xattr_get(struct inode *host, const char
 *name, void *buf, if (buf) {
 		/* If @buf is %NULL we are supposed to return the length */
 		if (ui->data_len > size) {
-			ubifs_err(c, "buffer size %zd, xattr len %d",
+			ubifs_warn(c, "buffer size %zd, xattr len %d",
 				  size, ui->data_len);

Hmm, if this can be triggered that easy I suggest getting completely rid of this message.

Thanks,
//richard

author
#2 lore raw
Quoted 11 lines
Quoted 11 lines

Just print warning message when xattr value size is bigger than the buffer size. There is a situation that other modules, like overlayfs, try to get xattr value with a small buffer, if they get -ERANGE, they will try again with the proper buffer size. No need to report a error message, warning message is enough.

---
 fs/ubifs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

fs/ubifs/xattr.c ssize_t ubifs_xattr_get(struct inode *host, const char · line 385

Quoted 11 lines
fs/ubifs/xattr.c +1 -1
index 5ddc89d..bc20530 100644
@@ -381,7 +381,7 @@ ssize_t ubifs_xattr_get(struct inode *host, const char
 *name, void *buf, if (buf) {
              /* If @buf is %NULL we are supposed to return the length */
              if (ui->data_len > size) {
-                     ubifs_err(c, "buffer size %zd, xattr len %d",
+                     ubifs_warn(c, "buffer size %zd, xattr len %d",
                                size, ui->data_len);

Hmm, if this can be triggered that easy I suggest getting completely rid of this message.

OK, forget about this one, I am going to send you another patch to get rid of this message

Signature · 2 lines
Cheers,
Rock