1
0
Fork 0

Btrfs: fix oops when btrfs_inherit_iflags called with a NULL dir

This happens during subvol creation.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
hifive-unleashed-5.1
Chris Mason 2009-06-11 11:13:35 -04:00
parent 067c28adc5
commit 0b4dcea579
1 changed files with 6 additions and 1 deletions

View File

@ -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;