diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-29 15:14:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-29 15:14:37 -0400 |
commit | 4f46accee45d74a408e417c04c0ed1543a7c51e9 (patch) | |
tree | d7bf042ab27280c9f45c1ab3959e65a3db131f59 /fs/block_dev.c | |
parent | 543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff) | |
parent | cdd16d0265c9234228fd37fbbad844d7e894b278 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
[patch 2/3] vfs: dcache cleanups
[patch 1/3] vfs: dcache sparse fixes
[patch 3/3] vfs: make d_path() consistent across mount operations
[patch 4/4] flock: remove unused fields from file_lock_operations
[patch 3/4] vfs: fix ERR_PTR abuse in generic_readlink
[patch 2/4] fs: make struct file arg to d_path const
[patch 1/4] vfs: path_{get,put}() cleanups
[patch for 2.6.26 4/4] vfs: utimensat(): fix write access check for futimens()
[patch for 2.6.26 3/4] vfs: utimensat(): fix error checking for {UTIME_NOW,UTIME_OMIT} case
[patch for 2.6.26 1/4] vfs: utimensat(): ignore tv_sec if tv_nsec == UTIME_OMIT or UTIME_NOW
[patch for 2.6.26 2/4] vfs: utimensat(): be consistent with utime() for immutable and append-only files
[PATCH] fix cgroup-inflicted breakage in block_dev.c
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r-- | fs/block_dev.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 470c10ceb0fb..10d8a0aa871a 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -931,8 +931,16 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part) | |||
931 | struct gendisk *disk; | 931 | struct gendisk *disk; |
932 | int ret; | 932 | int ret; |
933 | int part; | 933 | int part; |
934 | int perm = 0; | ||
934 | 935 | ||
935 | ret = devcgroup_inode_permission(bdev->bd_inode, file->f_mode); | 936 | if (file->f_mode & FMODE_READ) |
937 | perm |= MAY_READ; | ||
938 | if (file->f_mode & FMODE_WRITE) | ||
939 | perm |= MAY_WRITE; | ||
940 | /* | ||
941 | * hooks: /n/, see "layering violations". | ||
942 | */ | ||
943 | ret = devcgroup_inode_permission(bdev->bd_inode, perm); | ||
936 | if (ret != 0) | 944 | if (ret != 0) |
937 | return ret; | 945 | return ret; |
938 | 946 | ||