summaryrefslogtreecommitdiff
path: root/ext2fs
diff options
context:
space:
mode:
Diffstat (limited to 'ext2fs')
-rw-r--r--ext2fs/xattr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext2fs/xattr.c b/ext2fs/xattr.c
index 4592d5e4..41e8c89c 100644
--- a/ext2fs/xattr.c
+++ b/ext2fs/xattr.c
@@ -686,6 +686,14 @@ ext2_set_xattr (struct node *np, const char *name, const char *value,
ei = dino_ref (np->cache_id);
blkno = ei->i_file_acl;
+ /* Avoid allocating a block if this is a request to delete data. */
+ if (blkno == 0 && value == NULL)
+ {
+ block = NULL;
+ err = ENODATA;
+ goto cleanup;
+ }
+
if (blkno == 0)
{
/* Allocate and initialize new block */