diff options
author | Anand Jain <anand.jain@oracle.com> | 2019-04-20 19:48:51 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-04-29 19:02:52 +0200 |
commit | f22125e5d8ae136adb99552d97078702e1ee68ab (patch) | |
tree | 091574a84bd201eff96baa3e9d20b3751c3f2f6c /fs/btrfs/xattr.c | |
parent | 7c15d41016dc886cc011e3854d855e219759ae68 (diff) | |
download | linux-f22125e5d8ae136adb99552d97078702e1ee68ab.tar.bz2 |
btrfs: refactor btrfs_set_props to validate externally
In preparation to merge multiple transactions when setting the
compression flags, split btrfs_set_props() validation part outside of
it.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/xattr.c')
-rw-r--r-- | fs/btrfs/xattr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index cb45c02cdc44..09db8f5f08fe 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -371,7 +371,12 @@ static int btrfs_xattr_handler_set_prop(const struct xattr_handler *handler, const char *name, const void *value, size_t size, int flags) { + int ret; + name = xattr_full_name(handler, name); + ret = btrfs_validate_prop(name, value, size); + if (ret) + return ret; return btrfs_set_prop_trans(inode, name, value, size, flags); } |