acct: check FMODE_CAN_WRITE

it's not calling ->write() directly anymore.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2015-03-31 12:30:48 -04:00
parent 47e393622b
commit d0f88f8d5d

View 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;