aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/ioctl.c')
-rw-r--r--fs/nilfs2/ioctl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index 108d281ebca5..be387c6b2d46 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -516,14 +516,16 @@ static ssize_t
516nilfs_ioctl_do_free_segments(struct the_nilfs *nilfs, __u64 *posp, int flags, 516nilfs_ioctl_do_free_segments(struct the_nilfs *nilfs, __u64 *posp, int flags,
517 void *buf, size_t size, size_t nmembs) 517 void *buf, size_t size, size_t nmembs)
518{ 518{
519 struct nilfs_sb_info *sbi = nilfs_get_writer(nilfs); 519 struct nilfs_sb_info *sbi = nilfs->ns_writer;
520 int ret; 520 int ret;
521 521
522 if (unlikely(!sbi)) 522 if (unlikely(!sbi)) {
523 /* never happens because called for a writable mount */
524 WARN_ON(1);
523 return -EROFS; 525 return -EROFS;
526 }
524 ret = nilfs_segctor_add_segments_to_be_freed( 527 ret = nilfs_segctor_add_segments_to_be_freed(
525 NILFS_SC(sbi), buf, nmembs); 528 NILFS_SC(sbi), buf, nmembs);
526 nilfs_put_writer(nilfs);
527 529
528 return (ret < 0) ? ret : nmembs; 530 return (ret < 0) ? ret : nmembs;
529} 531}