Merge tag 'pci-v4.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
[cascardo/linux.git] / kernel / acct.c
index e6c10d1..74963d1 100644 (file)
@@ -213,7 +213,7 @@ static int acct_on(struct filename *pathname)
                return -EACCES;
        }
 
-       if (!file->f_op->write) {
+       if (!(file->f_mode & FMODE_CAN_WRITE)) {
                kfree(acct);
                filp_close(file, NULL);
                return -EIO;