]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/btrfs/file.c
Btrfs: Add workaround for AppArmor changing remove_suid()
[net-next-2.6.git] / fs / btrfs / file.c
index c89c3ac4b23b7d081d7a2cac636c5f1b62868b84..df97d470812a31bdfee7efbf4e86fe7d1eb68eac 100644 (file)
@@ -37,6 +37,7 @@
 #include "ordered-data.h"
 #include "ioctl.h"
 #include "print-tree.h"
+#include "compat.h"
 
 
 static int btrfs_copy_from_user(loff_t pos, int num_pages, int write_bytes,
@@ -852,7 +853,11 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
                goto out_nolock;
        if (count == 0)
                goto out_nolock;
+#ifdef REMOVE_SUID_PATH
+       err = remove_suid(&file->f_path);
+#else
        err = remove_suid(fdentry(file));
+#endif
        if (err)
                goto out_nolock;
        file_update_time(file);