Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b4dcea5 authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: fix oops when btrfs_inherit_iflags called with a NULL dir



This happens during subvol creation.

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 067c28ad
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;