We already have a helper for getting xattrs from inodes, namely ovl_getxattr, but it doesn't allow for copying xattrs onto the current stack. In addition, it is not instrumented like the rest of the helpers. Signed-off-by: Sargun Dhillon <sargun@xxxxxxxxx> Cc: linux-fsdevel@xxxxxxxxxxxxxxx Cc: linux-unionfs@xxxxxxxxxxxxxxx Cc: Miklos Szeredi <miklos@xxxxxxxxxx> Cc: Amir Goldstein <amir73il@xxxxxxxxx> --- fs/overlayfs/overlayfs.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index 29bc1ec699e7..9eb911f243e1 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h @@ -179,6 +179,15 @@ static inline int ovl_do_setxattr(struct dentry *dentry, const char *name, return err; } +static inline int ovl_do_getxattr(struct dentry *dentry, const char *name, + void *value, size_t size) +{ + int err = vfs_getxattr(dentry, name, value, size); + pr_debug("getxattr(%pd2, \"%s\", \"%*pE\", %zu) = %i\n", + dentry, name, min((int)size, 48), value, size, err); + return err; +} + static inline int ovl_do_removexattr(struct dentry *dentry, const char *name) { int err = vfs_removexattr(dentry, name); -- 2.25.1