diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_lrw.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 7e90daa0d1d1..9142192ccbe6 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -751,10 +751,26 @@ start: | |||
751 | goto relock; | 751 | goto relock; |
752 | } | 752 | } |
753 | } else { | 753 | } else { |
754 | int enospc = 0; | ||
755 | ssize_t ret2 = 0; | ||
756 | |||
757 | write_retry: | ||
754 | xfs_rw_enter_trace(XFS_WRITE_ENTER, xip, (void *)iovp, segs, | 758 | xfs_rw_enter_trace(XFS_WRITE_ENTER, xip, (void *)iovp, segs, |
755 | *offset, ioflags); | 759 | *offset, ioflags); |
756 | ret = generic_file_buffered_write(iocb, iovp, segs, | 760 | ret2 = generic_file_buffered_write(iocb, iovp, segs, |
757 | pos, offset, count, ret); | 761 | pos, offset, count, ret); |
762 | /* | ||
763 | * if we just got an ENOSPC, flush the inode now we | ||
764 | * aren't holding any page locks and retry *once* | ||
765 | */ | ||
766 | if (ret2 == -ENOSPC && !enospc) { | ||
767 | error = xfs_flush_pages(xip, 0, -1, 0, FI_NONE); | ||
768 | if (error) | ||
769 | goto out_unlock_internal; | ||
770 | enospc = 1; | ||
771 | goto write_retry; | ||
772 | } | ||
773 | ret = ret2; | ||
758 | } | 774 | } |
759 | 775 | ||
760 | current->backing_dev_info = NULL; | 776 | current->backing_dev_info = NULL; |