Skip to contentSkip to conversation

sload.f2fs: fix the missing of bit mask for file type

PATCH In review Junling Zheng 3 participants 4 messages May 3, 2018 – May 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sload.f2fs: fix the missing of bit mask for file type

Fix the missing of bit mask for the file type bit fields.

---
 fsck/sload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fsck/sload.c +1 -1
index 2842f2c..1b7a2d1 100644
@@ -157,7 +157,7 @@ static void set_inode_metadata(struct dentry *de)
 
 	de->size = stat.st_size;
 	de->mode = stat.st_mode &
-			(S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO);
+			(S_IFMT|S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO);
 	if (c.fixed_time == -1 && c.from_dir)
 		de->mtime = stat.st_mtime;
 	else
Signature · 6 lines
2.16.2


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
#2 lore raw
In reply to Junling Zheng

Hi, Jaegeuk

Could you please merge this fix into external/f2fs-tools repo for AOSP? Since we found this bug while using sload feature in Android P :)

Thanks,
Junling

Quoted 14 lines · Junling Zheng

Fix the missing of bit mask for the file type bit fields.

---
 fsck/sload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fsck/sload.c +0 -0
index 2842f2c..1b7a2d1 100644

fsck/sload.c static void set_inode_metadata(struct dentry *de) · line 163

Quoted 8 lines
fsck/sload.c +1 -1
@@ -157,7 +157,7 @@ static void set_inode_metadata(struct dentry *de)
 
 	de->size = stat.st_size;
 	de->mode = stat.st_mode &
-			(S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO);
+			(S_IFMT|S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO);
 	if (c.fixed_time == -1 && c.from_dir)
 		de->mtime = stat.st_mtime;
 	else

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot

#3 lore raw
Quoted 4 lines · Junling Zheng

Hi, Jaegeuk

Could you please merge this fix into external/f2fs-tools repo for AOSP? Since we found this bug while using sload feature in Android P :)

Sure. Will prepare soon.
Thanks,

Quoted 19 lines

Thanks,
Junling

Quoted 14 lines · Junling Zheng

Fix the missing of bit mask for the file type bit fields.

---
 fsck/sload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fsck/sload.c +0 -0
index 2842f2c..1b7a2d1 100644
@@ -157,7 +157,7 @@ static void set_inode_metadata(struct dentry *de)
 
Quoted 9 lines

fsck/sload.c static void set_inode_metadata(struct dentry *de) · line 163

Quoted 8 lines
fsck/sload.c +1 -1
 	de->size = stat.st_size;
 	de->mode = stat.st_mode &
-			(S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO);
+			(S_IFMT|S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO);
 	if (c.fixed_time == -1 && c.from_dir)
 		de->mtime = stat.st_mtime;
 	else

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot