Skip to content

Commit

Permalink
Btrfs: fix oops when btrfs_inherit_iflags called with a NULL dir
Browse files Browse the repository at this point in the history
This happens during subvol creation.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Jun 11, 2009
1 parent 067c28a commit 0b4dcea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ void btrfs_update_iflags(struct inode *inode)
*/
void btrfs_inherit_iflags(struct inode *inode, struct inode *dir)
{
unsigned int flags = BTRFS_I(dir)->flags;
unsigned int flags;

if (!dir)
return;

flags = BTRFS_I(dir)->flags;

if (S_ISREG(inode->i_mode))
flags &= ~BTRFS_INODE_DIRSYNC;
Expand Down

0 comments on commit 0b4dcea

Please sign in to comment.