Skip to contentSkip to conversation

sload.f2fs: give correct file type

PATCH In review Jaegeuk Kim 2 participants 3 messages May 7, 2018 – May 8, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sload.f2fs: give correct file type

From: Lianjun Huang <[email protected]>

This fixes permission error due to wrong file type.

---
 fsck/sload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fsck/sload.c +1 -1
index 2842f2c..2fb13f2 100644
@@ -106,7 +106,7 @@ static int set_perms_and_caps(struct dentry *de)
 
 	/* Permissions */
 	if (fs_config_func != NULL) {
-		fs_config_func(mnt_path, S_ISDIR(de->mode),
+		fs_config_func(mnt_path, de->file_type == F2FS_FT_DIR,
 				c.target_out_dir, &uid, &gid, &imode,
 				&capabilities);
 		de->uid = uid & 0xffff;
Signature · 6 lines
2.17.0.484.g0c8726318c-goog


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

Hi, Jaegeuk

My previous patch (sload.f2fs: fix the missing of bit mask for file type) had already fix this bug :)

Thanks,
Junling

Quoted 16 lines · Jaegeuk Kim

From: Lianjun Huang <[email protected]>

This fixes permission error due to wrong file type.

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

fsck/sload.c static int set_perms_and_caps(struct dentry *de) · line 112

Quoted 8 lines
fsck/sload.c +1 -1
@@ -106,7 +106,7 @@ static int set_perms_and_caps(struct dentry *de)
 
 	/* Permissions */
 	if (fs_config_func != NULL) {
-		fs_config_func(mnt_path, S_ISDIR(de->mode),
+		fs_config_func(mnt_path, de->file_type == F2FS_FT_DIR,
 				c.target_out_dir, &uid, &gid, &imode,
 				&capabilities);
 		de->uid = uid & 0xffff;

------------------------------------------------------------------------------
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
Quoted 4 lines · Junling Zheng

Hi, Jaegeuk

My previous patch (sload.f2fs: fix the missing of bit mask for file type) had already fix this bug :)

I guessed it before, but this is also reasonable to me where de->file_type is based on F2FS_FT_DIR.

Quoted 21 lines

Thanks,
Junling

Quoted 16 lines · Jaegeuk Kim

From: Lianjun Huang <[email protected]>

This fixes permission error due to wrong file type.

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

fsck/sload.c static int set_perms_and_caps(struct dentry *de) · line 112

Quoted 8 lines
fsck/sload.c +1 -1
 	/* Permissions */
 	if (fs_config_func != NULL) {
-		fs_config_func(mnt_path, S_ISDIR(de->mode),
+		fs_config_func(mnt_path, de->file_type == F2FS_FT_DIR,
 				c.target_out_dir, &uid, &gid, &imode,
 				&capabilities);
 		de->uid = uid & 0xffff;

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