Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d18a8679
Commit
d18a8679
authored
May 02, 2024
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make set_blocksize() fail unless block device is opened exclusive
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ead083ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
Documentation/filesystems/porting.rst
Documentation/filesystems/porting.rst
+7
-0
block/bdev.c
block/bdev.c
+3
-0
No files found.
Documentation/filesystems/porting.rst
View file @
d18a8679
...
...
@@ -1134,3 +1134,10 @@ superblock of the main block device, i.e., the one stored in sb->s_bdev. Block
device freezing now works for any block device owned by a given superblock, not
just the main block device. The get_active_super() helper and bd_fsfreeze_sb
pointer are gone.
---
**mandatory**
set_blocksize() takes opened struct file instead of struct block_device now
and it *must* be opened exclusive.
block/bdev.c
View file @
d18a8679
...
...
@@ -157,6 +157,9 @@ int set_blocksize(struct file *file, int size)
if
(
size
<
bdev_logical_block_size
(
bdev
))
return
-
EINVAL
;
if
(
!
file
->
private_data
)
return
-
EINVAL
;
/* Don't change the size if it is same as current */
if
(
inode
->
i_blkbits
!=
blksize_bits
(
size
))
{
sync_blockdev
(
bdev
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment