diff mbox series

ubifs: setflags: Don't show error message when vfs_ioc_setflags_prepare() fails

Message ID 20200828033250.910168-1-chengzhihao1@huawei.com
State Accepted
Headers show
Series ubifs: setflags: Don't show error message when vfs_ioc_setflags_prepare() fails | expand

Commit Message

Zhihao Cheng Aug. 28, 2020, 3:32 a.m. UTC
Following process will trigger ubifs_err:
  1. useradd -m freg                                        (Under root)
  2. cd /home/freg && mkdir mp                              (Under freg)
  3. mount -t ubifs /dev/ubi0_0 /home/freg/mp               (Under root)
  4. cd /home/freg && echo 123 > mp/a			    (Under root)
  5. cd mp && chown freg a && chgrp freg a && chmod 777 a   (Under root)
  6. chattr +i a                                            (Under freg)

UBIFS error (ubi0:0 pid 1723): ubifs_ioctl [ubifs]: can't modify inode
65 attributes
chattr: Operation not permitted while setting flags on a

This is not an UBIFS problem, it was caused by task priviliage checking
on file operations. Remove error message printing from kernel just like
other filesystems (eg. ext4), since we already have enough information
from userspace tools.

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
---
 fs/ubifs/ioctl.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Richard Weinberger Aug. 30, 2020, 7:23 p.m. UTC | #1
On Fri, Aug 28, 2020 at 5:33 AM Zhihao Cheng <chengzhihao1@huawei.com> wrote:
>
> Following process will trigger ubifs_err:
>   1. useradd -m freg                                        (Under root)
>   2. cd /home/freg && mkdir mp                              (Under freg)
>   3. mount -t ubifs /dev/ubi0_0 /home/freg/mp               (Under root)
>   4. cd /home/freg && echo 123 > mp/a                       (Under root)
>   5. cd mp && chown freg a && chgrp freg a && chmod 777 a   (Under root)
>   6. chattr +i a                                            (Under freg)
>
> UBIFS error (ubi0:0 pid 1723): ubifs_ioctl [ubifs]: can't modify inode
> 65 attributes
> chattr: Operation not permitted while setting flags on a
>
> This is not an UBIFS problem, it was caused by task priviliage checking
> on file operations. Remove error message printing from kernel just like
> other filesystems (eg. ext4), since we already have enough information
> from userspace tools.
>
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> ---
>  fs/ubifs/ioctl.c | 1 -
>  1 file changed, 1 deletion(-)

Makes sense, thanks for fixing!
BTW: I didn't forget about the other valuable fixes from you, in the
next two weeks I'll hopefully
find more time for reviewing/testing. :-)
Richard Weinberger Sept. 13, 2020, 6:39 p.m. UTC | #2
On Sun, Aug 30, 2020 at 9:23 PM Richard Weinberger
<richard.weinberger@gmail.com> wrote:
>
> On Fri, Aug 28, 2020 at 5:33 AM Zhihao Cheng <chengzhihao1@huawei.com> wrote:
> >
> > Following process will trigger ubifs_err:
> >   1. useradd -m freg                                        (Under root)
> >   2. cd /home/freg && mkdir mp                              (Under freg)
> >   3. mount -t ubifs /dev/ubi0_0 /home/freg/mp               (Under root)
> >   4. cd /home/freg && echo 123 > mp/a                       (Under root)
> >   5. cd mp && chown freg a && chgrp freg a && chmod 777 a   (Under root)
> >   6. chattr +i a                                            (Under freg)
> >
> > UBIFS error (ubi0:0 pid 1723): ubifs_ioctl [ubifs]: can't modify inode
> > 65 attributes
> > chattr: Operation not permitted while setting flags on a
> >
> > This is not an UBIFS problem, it was caused by task priviliage checking
> > on file operations. Remove error message printing from kernel just like
> > other filesystems (eg. ext4), since we already have enough information
> > from userspace tools.
> >
> > Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> > ---
> >  fs/ubifs/ioctl.c | 1 -
> >  1 file changed, 1 deletion(-)
>
> Makes sense, thanks for fixing!

Applied to fixes.
diff mbox series

Patch

diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c
index 3df9be2c684c..4363d85a3fd4 100644
--- a/fs/ubifs/ioctl.c
+++ b/fs/ubifs/ioctl.c
@@ -134,7 +134,6 @@  static int setflags(struct inode *inode, int flags)
 	return err;
 
 out_unlock:
-	ubifs_err(c, "can't modify inode %lu attributes", inode->i_ino);
 	mutex_unlock(&ui->ui_mutex);
 	ubifs_release_budget(c, &req);
 	return err;