ubi: Don't bypass ->getattr()
authorRichard Weinberger <richard@nod.at>
Sun, 12 Jun 2016 22:49:04 +0000 (00:49 +0200)
committerRichard Weinberger <richard@nod.at>
Tue, 14 Jun 2016 08:51:42 +0000 (10:51 +0200)
commit61edc3f3b51d2d3948029197cfff6fef7d94e939
tree0bcdb8eaa9992c0eabe6ec43b175cf7afa3f1b6a
parent1a498ec45eeabcb246c3c3f5822ed9ac1b4f70d8
ubi: Don't bypass ->getattr()

Directly accessing inode fields bypasses ->getattr()
and can cause problems when the underlying filesystem
does not have the default ->getattr() implementation.

So instead of obtaining the backing inode via d_backing_inode()
use vfs_getattr() and obtain what we need from the kstat struct.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/build.c
drivers/mtd/ubi/kapi.c