Skip to content

Commit

Permalink
hfsplus: initialise userflags
Browse files Browse the repository at this point in the history
The userflags field was being written to the filesystem without being
initialised. Make sure it's clear, since otherwise files end up with
garbage attributes.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Matthew Garrett authored and Al Viro committed Mar 21, 2012
1 parent 7cd916f commit f392238
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/hfsplus/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ static struct dentry *hfsplus_file_lookup(struct inode *dir,
mutex_init(&hip->extents_lock);
hip->extent_state = 0;
hip->flags = 0;
hip->userflags = 0;
set_bit(HFSPLUS_I_RSRC, &hip->flags);

err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd);
Expand Down Expand Up @@ -400,6 +401,7 @@ struct inode *hfsplus_new_inode(struct super_block *sb, umode_t mode)
atomic_set(&hip->opencnt, 0);
hip->extent_state = 0;
hip->flags = 0;
hip->userflags = 0;
memset(hip->first_extents, 0, sizeof(hfsplus_extent_rec));
memset(hip->cached_extents, 0, sizeof(hfsplus_extent_rec));
hip->alloc_blocks = 0;
Expand Down

0 comments on commit f392238

Please sign in to comment.