]> git.baikalelectronics.ru Git - kernel.git/commit
nilfs2: fix improper return values of nilfs_get_cpinfo ioctl
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tue, 7 Apr 2009 02:01:48 +0000 (19:01 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Apr 2009 15:31:17 +0000 (08:31 -0700)
commit2bff37c401502b1cb22333a7e1621c1263c13044
treed3678ad2cbfb41624af0058b7de1ee2d48b7334c
parenta02b0185cb7957e37ec596a181dabf778e051f52
nilfs2: fix improper return values of nilfs_get_cpinfo ioctl

A few tool developers gave me requests for fixing inconvenient return
value of nilfs_get_cpinfo() ioctl; if the requested mode is NILFS_SNAPSHOT
and the specified start entry is not a snapshot, the ioctl unnaturally
returns one as the number of acquired snapshot item.

In addition, the ioctl function returns an ENOENT error for checkpoints
within blocks deleted by garbage collection.

These behaviors require corrections for programs which enumerate
snapshots.  This resolves the inconvenience by changing the return values
to zero for the above cases.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nilfs2/cpfile.c