diff options
author | Richard Braun <rbraun@sceen.net> | 2017-01-06 20:44:04 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-01-06 20:47:20 +0100 |
commit | 41857c776d63bfed4c14bd882b3c9eade1f52e4d (patch) | |
tree | 6c6bafdb7146602e710c9270227d9c50cbd178b8 /ext2fs | |
parent | 109f842edae5297ad9c9ec3c8d88e2c74c9b0ca0 (diff) | |
download | hurd-41857c776d63bfed4c14bd882b3c9eade1f52e4d.tar.gz hurd-41857c776d63bfed4c14bd882b3c9eade1f52e4d.tar.bz2 hurd-41857c776d63bfed4c14bd882b3c9eade1f52e4d.zip |
ext2fs: fix block reference
ext2fs/xattr.c (ext2_get_xattr): Keep the inode reference until the
block reference is done.
Diffstat (limited to 'ext2fs')
-rw-r--r-- | ext2fs/xattr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ext2fs/xattr.c b/ext2fs/xattr.c index 13668845..6507a971 100644 --- a/ext2fs/xattr.c +++ b/ext2fs/xattr.c @@ -582,7 +582,6 @@ ext2_get_xattr (struct node *np, const char *name, char *value, size_t *len) int err; void *block; struct ext2_inode *ei; - block_t blkno; struct ext2_xattr_header *header; struct ext2_xattr_entry *entry; @@ -601,15 +600,15 @@ ext2_get_xattr (struct node *np, const char *name, char *value, size_t *len) size = *len; ei = dino_ref (np->cache_id); - blkno = ei->i_file_acl; - dino_deref (ei); - if (blkno == 0) + if (ei->i_file_acl == 0) { + dino_deref (ei); return ENODATA; } - block = disk_cache_block_ref (blkno); + block = disk_cache_block_ref (ei->i_file_acl); + dino_deref (ei); header = EXT2_XATTR_HEADER (block); if (header->h_magic != EXT2_XATTR_BLOCK_MAGIC || header->h_blocks != 1) |