projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
806638b
)
Btrfs: Make sure dir is non-null before doing S_ISGID checks
author
Chris Mason
<chris.mason@oracle.com>
Fri, 6 Feb 2009 16:35:57 +0000
(11:35 -0500)
committer
Chris Mason
<chris.mason@oracle.com>
Fri, 6 Feb 2009 16:35:57 +0000
(11:35 -0500)
The S_ISGID check in btrfs_new_inode caused an oops during subvol creation
because sometimes the dir is null.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/btrfs/inode.c
b/fs/btrfs/inode.c
index ddb0f0ecda6c3a8633dabcab8b5b265192df0f56..8f0706210a478cc8866b3dd280b2860e75089757 100644
(file)
--- a/
fs/btrfs/inode.c
+++ b/
fs/btrfs/inode.c
@@
-3491,7
+3491,7
@@
static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
inode->i_uid = current_fsuid();
- if (dir
->i_mode & S_ISGID
) {
+ if (dir
&& (dir->i_mode & S_ISGID)
) {
inode->i_gid = dir->i_gid;
if (S_ISDIR(mode))
mode |= S_ISGID;