summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/xattr.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 03:21:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 03:21:38 +0000
commit9351405e44641037ccff29c0d88d92c0617b5088 (patch)
treedfee90e28394ae31df1033696f8656add6c4fc26 /fs/btrfs/xattr.c
parentReleasing progress-linux version 4.19.249-2progress5u1. (diff)
downloadlinux-9351405e44641037ccff29c0d88d92c0617b5088.tar.xz
linux-9351405e44641037ccff29c0d88d92c0617b5088.zip
Merging upstream version 4.19.260.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fs/btrfs/xattr.c')
-rw-r--r--fs/btrfs/xattr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c
index f141b45ce..6adee9463 100644
--- a/fs/btrfs/xattr.c
+++ b/fs/btrfs/xattr.c
@@ -369,6 +369,9 @@ static int btrfs_xattr_handler_set(const struct xattr_handler *handler,
const char *name, const void *buffer,
size_t size, int flags)
{
+ if (btrfs_root_readonly(BTRFS_I(inode)->root))
+ return -EROFS;
+
name = xattr_full_name(handler, name);
return btrfs_setxattr(NULL, inode, name, buffer, size, flags);
}