Skip to content

Commit

Permalink
UBIFS: make debugfs files non-seekable
Browse files Browse the repository at this point in the history
Turn the debufs files UBIFS maintains into non-seekable. Indeed, none
of them is supposed to be seek'ed.

Do this by making the '.lseek()' handler to be 'no_llseek()' and by
using 'nonseekable_open()' in the '.open()' operation.

This does mean an API break but this debugging API is only used by a couple
of test scripts which do not rely in the 'llseek()' operation.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed May 13, 2011
1 parent 693d92a commit 1bbfc84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ubifs/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,7 @@ void dbg_debugfs_exit(void)
static int open_debugfs_file(struct inode *inode, struct file *file)
{
file->private_data = inode->i_private;
return 0;
return nonseekable_open(inode, file);
}

static ssize_t write_debugfs_file(struct file *file, const char __user *buf,
Expand Down Expand Up @@ -2814,7 +2814,7 @@ static const struct file_operations dfs_fops = {
.open = open_debugfs_file,
.write = write_debugfs_file,
.owner = THIS_MODULE,
.llseek = default_llseek,
.llseek = no_llseek,
};

/**
Expand Down

0 comments on commit 1bbfc84

Please sign in to comment.