Skip to content

Commit

Permalink
fs: readdir: Fix su hide patch for non-iterate filesystems
Browse files Browse the repository at this point in the history
* 3.10 doesn't normally use iterate for filesystems,
  but it was backported in hopes of removing vfs_readdir()
* Because the romnt variable was only set for filesystems
  using iterate, the su hide patches were broken for many
  filesytems like ext4, which still use vfs_readdir()
  instead of iterate_dir() like their mainline counterparts
* Remove the iterate check around setting romnt to fix this

Change-Id: I26426683df0fd199a80f053294f352e31754bec5
  • Loading branch information
Alberto97 authored and sayeed99 committed Jul 15, 2017
1 parent cbc822f commit 71955c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ int iterate_dir(struct file *file, struct dir_context *ctx)

res = -ENOENT;
if (!IS_DEADDIR(inode)) {
ctx->romnt = (inode->i_sb->s_flags & MS_RDONLY);
if (file->f_op->iterate) {
ctx->pos = file->f_pos;
ctx->romnt = (inode->i_sb->s_flags & MS_RDONLY);
res = file->f_op->iterate(file, ctx);
file->f_pos = ctx->pos;
} else {
Expand Down

0 comments on commit 71955c0

Please sign in to comment.