diff options
author | Chris Mason <chris.mason@oracle.com> | 2009-06-11 11:13:35 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-06-11 11:13:35 -0400 |
commit | 0b4dcea579a1b6f4d249d61f5bc8adeaa7c895d8 (patch) | |
tree | 2d8c0a56d853516136fcf9ff43672aca9f011057 /fs/btrfs | |
parent | 067c28adc53807514ac0c6ebb6af3243cbd071fa (diff) | |
download | kernel_samsung_tuna-0b4dcea579a1b6f4d249d61f5bc8adeaa7c895d8.zip kernel_samsung_tuna-0b4dcea579a1b6f4d249d61f5bc8adeaa7c895d8.tar.gz kernel_samsung_tuna-0b4dcea579a1b6f4d249d61f5bc8adeaa7c895d8.tar.bz2 |
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ioctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 926332a..eff18f5 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -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; |