diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_lrw.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 62 |
1 files changed, 3 insertions, 59 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 0d32457abef1..eac6f80d786d 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -630,18 +630,9 @@ start: | |||
630 | * by root. This keeps people from modifying setuid and | 630 | * by root. This keeps people from modifying setuid and |
631 | * setgid binaries. | 631 | * setgid binaries. |
632 | */ | 632 | */ |
633 | 633 | error = -file_remove_suid(file); | |
634 | if (((xip->i_d.di_mode & S_ISUID) || | 634 | if (unlikely(error)) |
635 | ((xip->i_d.di_mode & (S_ISGID | S_IXGRP)) == | 635 | goto out_unlock_internal; |
636 | (S_ISGID | S_IXGRP))) && | ||
637 | !capable(CAP_FSETID)) { | ||
638 | error = xfs_write_clear_setuid(xip); | ||
639 | if (likely(!error)) | ||
640 | error = -file_remove_suid(file); | ||
641 | if (unlikely(error)) { | ||
642 | goto out_unlock_internal; | ||
643 | } | ||
644 | } | ||
645 | 636 | ||
646 | /* We can write back this queue in page reclaim */ | 637 | /* We can write back this queue in page reclaim */ |
647 | current->backing_dev_info = mapping->backing_dev_info; | 638 | current->backing_dev_info = mapping->backing_dev_info; |
@@ -784,53 +775,6 @@ write_retry: | |||
784 | } | 775 | } |
785 | 776 | ||
786 | /* | 777 | /* |
787 | * All xfs metadata buffers except log state machine buffers | ||
788 | * get this attached as their b_bdstrat callback function. | ||
789 | * This is so that we can catch a buffer | ||
790 | * after prematurely unpinning it to forcibly shutdown the filesystem. | ||
791 | */ | ||
792 | int | ||
793 | xfs_bdstrat_cb(struct xfs_buf *bp) | ||
794 | { | ||
795 | if (XFS_FORCED_SHUTDOWN(bp->b_mount)) { | ||
796 | trace_xfs_bdstrat_shut(bp, _RET_IP_); | ||
797 | /* | ||
798 | * Metadata write that didn't get logged but | ||
799 | * written delayed anyway. These aren't associated | ||
800 | * with a transaction, and can be ignored. | ||
801 | */ | ||
802 | if (XFS_BUF_IODONE_FUNC(bp) == NULL && | ||
803 | (XFS_BUF_ISREAD(bp)) == 0) | ||
804 | return (xfs_bioerror_relse(bp)); | ||
805 | else | ||
806 | return (xfs_bioerror(bp)); | ||
807 | } | ||
808 | |||
809 | xfs_buf_iorequest(bp); | ||
810 | return 0; | ||
811 | } | ||
812 | |||
813 | /* | ||
814 | * Wrapper around bdstrat so that we can stop data from going to disk in case | ||
815 | * we are shutting down the filesystem. Typically user data goes thru this | ||
816 | * path; one of the exceptions is the superblock. | ||
817 | */ | ||
818 | void | ||
819 | xfsbdstrat( | ||
820 | struct xfs_mount *mp, | ||
821 | struct xfs_buf *bp) | ||
822 | { | ||
823 | ASSERT(mp); | ||
824 | if (!XFS_FORCED_SHUTDOWN(mp)) { | ||
825 | xfs_buf_iorequest(bp); | ||
826 | return; | ||
827 | } | ||
828 | |||
829 | trace_xfs_bdstrat_shut(bp, _RET_IP_); | ||
830 | xfs_bioerror_relse(bp); | ||
831 | } | ||
832 | |||
833 | /* | ||
834 | * If the underlying (data/log/rt) device is readonly, there are some | 778 | * If the underlying (data/log/rt) device is readonly, there are some |
835 | * operations that cannot proceed. | 779 | * operations that cannot proceed. |
836 | */ | 780 | */ |