From 33b5c4110cbd5fe07a18f757f3c5bbdfec9002aa Mon Sep 17 00:00:00 2001 From: Alberto97 Date: Tue, 23 May 2017 21:47:00 +0200 Subject: Fix "hide su" patch for 3.10 Without this, "ls system/xbin" returns "ls: system/xbin/su: No such file or directory" if root is disabled in Developer Settings. This happens because EXT4 uses "readdir" instead of "iterate". 3.18 kernel, instead, unconditionally goes for the "iterate" way here and that explains why I'm not seeing this error there. Change-Id: I26426683df0fd199a80f053294f352e31754bec5 --- fs/readdir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/readdir.c b/fs/readdir.c index d52d18d98..e1b7e1910 100644 --- a/fs/readdir.c +++ b/fs/readdir.c @@ -43,6 +43,7 @@ int iterate_dir(struct file *file, struct dir_context *ctx) res = file->f_op->iterate(file, ctx); file->f_pos = ctx->pos; } else { + ctx->romnt = (inode->i_sb->s_flags & MS_RDONLY); res = file->f_op->readdir(file, ctx, ctx->actor); ctx->pos = file->f_pos; } -- cgit v1.2.3