diff options
author | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:34:05 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:34:05 -0400 |
commit | 680a647b49fa52de0b37b8bc58a3a8c4bc76b262 (patch) | |
tree | a91fce973179b9e4d8ce77ca4f95fc8efca3255f /fs/xfs/linux-2.6/xfs_aops.c | |
parent | 1316d4da3f632d5843d5a446203e73067dc40f09 (diff) |
xfs: PF_FSTRANS should never be set in ->writepage
Now that we reject direct reclaim in addition to always using GFP_NOFS
allocation there's no chance we'll ever end up in ->writepage with
PF_FSTRANS set. Add a WARN_ON if we hit this case, and stop checking
if we'd actually need to start a transaction.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_aops.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 79ce38be15a1..60e1364a191f 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -894,11 +894,6 @@ out_invalidate: | |||
894 | * For unwritten space on the page we need to start the conversion to | 894 | * For unwritten space on the page we need to start the conversion to |
895 | * regular allocated space. | 895 | * regular allocated space. |
896 | * For any other dirty buffer heads on the page we should flush them. | 896 | * For any other dirty buffer heads on the page we should flush them. |
897 | * | ||
898 | * If we detect that a transaction would be required to flush the page, we | ||
899 | * have to check the process flags first, if we are already in a transaction | ||
900 | * or disk I/O during allocations is off, we need to fail the writepage and | ||
901 | * redirty the page. | ||
902 | */ | 897 | */ |
903 | STATIC int | 898 | STATIC int |
904 | xfs_vm_writepage( | 899 | xfs_vm_writepage( |
@@ -906,7 +901,6 @@ xfs_vm_writepage( | |||
906 | struct writeback_control *wbc) | 901 | struct writeback_control *wbc) |
907 | { | 902 | { |
908 | struct inode *inode = page->mapping->host; | 903 | struct inode *inode = page->mapping->host; |
909 | int delalloc, unwritten; | ||
910 | struct buffer_head *bh, *head; | 904 | struct buffer_head *bh, *head; |
911 | struct xfs_bmbt_irec imap; | 905 | struct xfs_bmbt_irec imap; |
912 | xfs_ioend_t *ioend = NULL, *iohead = NULL; | 906 | xfs_ioend_t *ioend = NULL, *iohead = NULL; |
@@ -938,15 +932,10 @@ xfs_vm_writepage( | |||
938 | goto redirty; | 932 | goto redirty; |
939 | 933 | ||
940 | /* | 934 | /* |
941 | * We need a transaction if there are delalloc or unwritten buffers | 935 | * Given that we do not allow direct reclaim to call us, we should |
942 | * on the page. | 936 | * never be called while in a filesystem transaction. |
943 | * | ||
944 | * If we need a transaction and the process flags say we are already | ||
945 | * in a transaction, or no IO is allowed then mark the page dirty | ||
946 | * again and leave the page as is. | ||
947 | */ | 937 | */ |
948 | xfs_count_page_state(page, &delalloc, &unwritten); | 938 | if (WARN_ON(current->flags & PF_FSTRANS)) |
949 | if ((current->flags & PF_FSTRANS) && (delalloc || unwritten)) | ||
950 | goto redirty; | 939 | goto redirty; |
951 | 940 | ||
952 | /* Is this page beyond the end of the file? */ | 941 | /* Is this page beyond the end of the file? */ |