diff options
-rw-r--r-- | kernel/acct.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/acct.c b/kernel/acct.c index 87773725a0dc..08963a292878 100644 --- a/kernel/acct.c +++ b/kernel/acct.c | |||
@@ -241,6 +241,8 @@ static int acct_on(struct filename *pathname) | |||
241 | return 0; | 241 | return 0; |
242 | } | 242 | } |
243 | 243 | ||
244 | static DEFINE_MUTEX(acct_on_mutex); | ||
245 | |||
244 | /** | 246 | /** |
245 | * sys_acct - enable/disable process accounting | 247 | * sys_acct - enable/disable process accounting |
246 | * @name: file name for accounting records or NULL to shutdown accounting | 248 | * @name: file name for accounting records or NULL to shutdown accounting |
@@ -263,7 +265,9 @@ SYSCALL_DEFINE1(acct, const char __user *, name) | |||
263 | struct filename *tmp = getname(name); | 265 | struct filename *tmp = getname(name); |
264 | if (IS_ERR(tmp)) | 266 | if (IS_ERR(tmp)) |
265 | return PTR_ERR(tmp); | 267 | return PTR_ERR(tmp); |
268 | mutex_lock(&acct_on_mutex); | ||
266 | error = acct_on(tmp); | 269 | error = acct_on(tmp); |
270 | mutex_unlock(&acct_on_mutex); | ||
267 | putname(tmp); | 271 | putname(tmp); |
268 | } else { | 272 | } else { |
269 | struct bsd_acct_struct *acct; | 273 | struct bsd_acct_struct *acct; |