]> git.ipfire.org Git - thirdparty/util-linux.git/commit - sys-utils/fstrim.c
fstrim: get realpath before trim ioctl
authorWang Shilong <wshilong@ddn.com>
Sun, 14 Apr 2019 03:31:56 +0000 (12:31 +0900)
committerKarel Zak <kzak@redhat.com>
Mon, 15 Apr 2019 09:12:55 +0000 (11:12 +0200)
commit8302b2009a5584c7503ff4c63eaf9f701836b46f
tree50711892a821bedf20a98ebbb5fbaaa6b0ac9f86
parent8b2464ae2ab3d73b9000e4567eeefac7b2366d77
fstrim: get realpath before trim ioctl

Original motivation is we want to run fstrim command
on Lustre[1] osd server mount point directly, however
our server mount point doesn't export osd directory
to users, and it will cause following command fail:

 $fstrim -v /mnt/mds/

But following succeed:

 $fstrim -v /mnt/mds

We could improve this a bit by getting realpath
before trapping kernel, this also give benifits
to normal use cases.

Cc: Andreas Dilger <adilger@dilger.ca>
Cc: Shuichi Ihara <sihara@ddn.com>
[1] http://wiki.lustre.org/Main_Page
Signed-off-by: Wang Shilong <wshilong@ddn.com>
sys-utils/fstrim.c