aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dfrag.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-07-05 08:30:55 +0200
committerIngo Molnar <mingo@elte.hu>2010-07-05 08:30:58 +0200
commit08f8ba07998ab1b9efcdd3f28dadf6866a605ddb (patch)
tree8e09855446f7b0312bb729d4b539090756e57927 /fs/xfs/xfs_dfrag.c
parentperf: Fix hist_entry__tui_annotate() build failure (diff)
parentLinux 2.6.35-rc4 (diff)
downloadlinux-dev-08f8ba07998ab1b9efcdd3f28dadf6866a605ddb.tar.xz
linux-dev-08f8ba07998ab1b9efcdd3f28dadf6866a605ddb.zip
Merge commit 'v2.6.35-rc4' into perf/core
Merge reason: Pick up the latest perf fixes Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/xfs/xfs_dfrag.c')
-rw-r--r--fs/xfs/xfs_dfrag.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c
index 5bba29a07812..7f159d2a429a 100644
--- a/fs/xfs/xfs_dfrag.c
+++ b/fs/xfs/xfs_dfrag.c
@@ -69,7 +69,9 @@ xfs_swapext(
goto out;
}
- if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND)) {
+ if (!(file->f_mode & FMODE_WRITE) ||
+ !(file->f_mode & FMODE_READ) ||
+ (file->f_flags & O_APPEND)) {
error = XFS_ERROR(EBADF);
goto out_put_file;
}
@@ -81,6 +83,7 @@ xfs_swapext(
}
if (!(tmp_file->f_mode & FMODE_WRITE) ||
+ !(tmp_file->f_mode & FMODE_READ) ||
(tmp_file->f_flags & O_APPEND)) {
error = XFS_ERROR(EBADF);
goto out_put_tmp_file;