Skip to content

Commit

Permalink
alloc_file(): simplify handling of mnt_clone_write() errors
Browse files Browse the repository at this point in the history
When alloc_file() and init_file() were combined, the error handling of
mnt_clone_write() was taken into alloc_file() in a somewhat obfuscated
way.  Since we don't use the error code for anything except warning,
we might as well warn directly without an extra variable.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Roland Dreier authored and Al Viro committed Dec 22, 2009
1 parent f7b84a6 commit 385e3ed
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/file_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,8 @@ struct file *alloc_file(struct path *path, fmode_t mode,
* that we can do debugging checks at __fput()
*/
if ((mode & FMODE_WRITE) && !special_file(path->dentry->d_inode->i_mode)) {
int error = 0;
file_take_write(file);
error = mnt_clone_write(path->mnt);
WARN_ON(error);
WARN_ON(mnt_clone_write(path->mnt));
}
ima_counts_get(file);
return file;
Expand Down

0 comments on commit 385e3ed

Please sign in to comment.