diff options
author | Chris Mason <chris.mason@oracle.com> | 2009-09-11 12:33:12 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-09-11 13:31:08 -0400 |
commit | 50a9b214bc6c052caa05a210ebfc1bdf0d7085b2 (patch) | |
tree | c5ae2e6a99778f237bdc88eb7157f7c4a82a2e54 /fs/btrfs/inode.c | |
parent | a1ed835e1ab5795f91b198d08c43e2f56848dcf3 (diff) | |
download | lwn-50a9b214bc6c052caa05a210ebfc1bdf0d7085b2.tar.gz lwn-50a9b214bc6c052caa05a210ebfc1bdf0d7085b2.zip |
Btrfs: fix btrfs page_mkwrite to return locked page
This closes a whole where the page may be written before
the page_mkwrite caller has a chance to dirty it
(thanks to Nick Piggin)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 233fe6f26120..c846482e7985 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4552,11 +4552,14 @@ again: } ClearPageChecked(page); set_page_dirty(page); + SetPageUptodate(page); BTRFS_I(inode)->last_trans = root->fs_info->generation + 1; unlock_extent(io_tree, page_start, page_end, GFP_NOFS); out_unlock: + if (!ret) + return VM_FAULT_LOCKED; unlock_page(page); out: return ret; |